syncapi

A command that synchronises one API route from source code into a Postman collection. An API route is an endpoint that accepts a request, such as POST /payments/refund.

In plain words
What is it for?
Use /postman:syncapi with a function name, route, or handler snippet to add or update one request, optionally placing it in a chosen collection folder.
Why use it?
It updates only the selected route and uses validation, verification, a change review, confirmation, and then writing, reducing accidental changes elsewhere.

Command

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 commands/logesh-works/postman-mcp/syncapi
Clone the repo
git clone --depth 1 https://github.com/logesh-works/postman-mcp
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 951 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.00000 $0.00951
Opus 5 $0.00000 $0.00476
Sonnet 5 $0.00000 $0.00190
Haiku 4.5 $0.00000 $0.00095

Measured yesterday against content hash e5b130c42020, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

syncapi 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 yesterday.

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.

docs/commands/syncapi.md · 87 lines

How it starts

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

/postman:syncapi: sync one API

The most surgical of the five commands. It syncs exactly one route and touches nothing else. Every other command is just a different way of picking which routes go through the same validate → verify → diff → confirm → write pipeline this one uses directly.

Usage

/postman:syncapi <function_name | "METHOD /route" | "pasted code"> [--into path] [--confirm]

For free-form instructions (add error responses, headers, an edited description, a persona, …), use /postman:prompt instead.

Targeting

You can identify the route three ways:

  • Function name, like create_payment
  • Route string, like "POST /payments/refund"
  • Pasted code, a snippet of the handler

If the target is ambiguous (the same name matches more than one route), the command lists the candidates and asks you to be specific. It never guesses.

Flags

Flag Effect
--into <path> Folder inside the collection where the request lands, for example payments or auth/oauth. Missing folders are created automatically. If omitted, falls back to config.defaultInto, which defaults to the collection root. No folder gets inferred from the route or function name.
--confirm Only required when targeting a collection other than the configured default. A safety rail, not something you'll normally need.

Example

/postman:syncapi create_payment --into payments
Collection: Acme Backend
Plan: 1 new · 0 modified

[NEW] POST /payments   → payments   ✓ verified (app/payments.py:12)

Write to Postman? Re-run with confirm=true to apply.

Each line is labelled ✓ verified (the citation matches your code), ~ stale (the code moved since it was cited), or ⚠ CITATION DOES NOT MATCH CODE — so you can see which requests are backed by real code before you say yes. An endpoint that fails verification is excluded from the write unless you name it explicitly.

What happens, step by step

  1. Find the endpoint. Claude uses the repository index to locate create_payment and read the exact code it needs — the handler, its request/response types, and its route registration — without reading the project unbounded.
  2. Author the request. Claude writes a complete Postman request (method, path, params, body, auth, responses) into collection.json, plus a file:line citation for every claimed fact in metadata.json.
  3. Validate and verify. The MCP server checks the collection is well-formed, re-reads every cited line to confirm it matches what Claude claimed, and grounds every claimed request/response field against the real DTO/model class.
  4. Diff. The server reads the live collection, matches POST /payments by METHOD + normalized path, and renders the before/after preview — a new request if no match is found, resolving --into payments to a folder (creating it if needed).
  5. Confirm. The diff is always shown. A non-default collection target additionally needs --confirm.
  6. Write. Merge into the collection JSON and PUT /collections/{uid}.
  7. Record. Update lastUpdate in postman/config.json. Claude shows the write result and stops; no further analysis or follow-on commentary.

Read the full file on GitHub · 87 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. yesterday First seen · 87 lines · 0 tokens per session scan A e5b130c42020

Subscribe to this mod's changes

syncapi is a command published in the GitHub repository logesh-works/postman-mcp (1 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 951 tokens. 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.