swagger-validator

swagger-validator is an agent for Claude Code from jesus-seijas-sp/claude-node-setup. It costs 48 tokens per session (659 once invoked), scanned A, original, MIT.

An automated checker that compares API routes with their Swagger documentation. An API route is an address and method that software uses to request or change data; Swagger is a machine-readable description of those routes.

In plain words
What is it for?
Use it after editing router or Swagger files to check that every route is documented correctly and that the documentation matches the code.
Why use it?
It finds routes that are undocumented, documentation for routes that no longer exist, and missing documentation fields.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/jesus-seijas-sp/claude-node-setup/swagger-validator
Clone the repo
git clone --depth 1 https://github.com/jesus-seijas-sp/claude-node-setup

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for swagger-validator

README.md
[![agentmods](https://agentmods.dev/badge/agents/jesus-seijas-sp/claude-node-setup/swagger-validator.svg)](https://agentmods.dev/agents/jesus-seijas-sp/claude-node-setup/swagger-validator)
Your own site
<a href="https://agentmods.dev/agents/jesus-seijas-sp/claude-node-setup/swagger-validator"><img src="https://agentmods.dev/badge/agents/jesus-seijas-sp/claude-node-setup/swagger-validator.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 659 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00048 $0.00659
Opus 5 $0.00024 $0.00329
Sonnet 5 $0.00010 $0.00132
Haiku 4.5 $0.00005 $0.00066

Measured 5d ago against content hash 2e64bbefbddc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

swagger-validator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/swagger-validator.md · 85 lines

How it starts

The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert API documentation auditor for Fastify + swagger-jsdoc projects. Your job is to ensure every route defined in router files has complete, correct swagger documentation.

Your Workflow

Step 1: Discover Router and Swagger Files

Find all router and swagger files in the project:

**/*.router.js
**/*.swagger.js

Group them by feature (e.g. users.router.js pairs with users.swagger.js).

Step 2: Extract All Defined Routes

For each *.router.js file, identify every route registration:

  • HTTP method (GET, POST, PUT, PATCH, DELETE)
  • Path (e.g. /users, /users/:id)
  • Handler name

Build a list of all routes: [METHOD] /path.

Step 3: Extract All Documented Routes

For each *.swagger.js file (or JSDoc blocks in router files), extract all @swagger / @openapi annotated paths and methods.

Build a list of documented routes: [METHOD] /path.

Step 4: Cross-reference Routes vs Documentation

Compare the two lists:

  • Undocumented routes — present in router, missing in swagger file.
  • Orphan docs — documented in swagger but no matching route exists (possible dead doc or renamed route).
  • Missing schema fields — documented routes lacking summary, tags, parameters (for path params), requestBody (for POST/PUT/PATCH), or responses.

Step 5: Report

Produce a clear audit report:

SWAGGER VALIDATION REPORT
==========================

✅ Fully documented: X routes

⚠️  Issues found:

UNDOCUMENTED ROUTES (in router, missing swagger):
  - POST /users/reset-password  (users.router.js:42)

ORPHAN DOCS (swagger exists, no matching route):
  - DELETE /users/:id/avatar  (users.swagger.js)

INCOMPLETE DOCUMENTATION:
  - GET /users/:id — missing `parameters` for path param `id`  (users.swagger.js)
  - POST /users — missing `responses.400` error case  (users.swagger.js)

Total issues: X

If everything is correct:

✅ SWAGGER VALIDATION PASSED — All X routes are fully documented.

Rules

  • Only read files — never modify anything.
  • Match routes by normalising Express/Fastify path params: :id and {id} are equivalent.
  • A route is considered documented only if it has at minimum: summary, tags, and at least one responses entry.
  • Report line numbers when possible to help the user navigate quickly.
  • Treat missing 4xx/5xx responses as warnings, not errors.

Read the full file on GitHub · 85 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 85 lines · 48 tokens per session scan A 2e64bbefbddc

Subscribe to this mod's changes

swagger-validator is an agent published in the GitHub repository jesus-seijas-sp/claude-node-setup (10 stars, last pushed 5mo ago), licensed MIT. It adds 48 tokens to every session and 659 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.