Skip to content

docs: align public contracts with URL-only document parsing - #1

Merged
sugus-d merged 3 commits into
mainfrom
docs/align-url-only-document-parsing
Aug 5, 2026
Merged

docs: align public contracts with URL-only document parsing#1
sugus-d merged 3 commits into
mainfrom
docs/align-url-only-document-parsing

Conversation

@sugus-d

@sugus-d sugus-d commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Why

The Gateway removed document.upload and switched document.parsing to HTTPS-URL-only input, but this repository still documented the upload-session flow. Anyone following the published docs hit hard failures:

  • POST /v1/tools/document.upload/call404 TOOL_NOT_FOUND
  • document_parsing {"uploadId":"..."}400 INVALID_ARGUMENTS

The endpoint count was also stale (24 vs. the 23 Tools the service actually exposes).

What changed

Correctness (the breaking part)

  • Removed document_upload / document.upload from both README tables; document_parsing now shows the real body {"fileUrl":"…","fileName":"…"}.
  • Rewrote the document-parsing Skill and Tool Reference around URL-only input, including the HTTPS / 1,024-character / must-have-host / no-userinfo constraints and the explicit list of rejected input forms.
  • Deleted skills/document-parsing/scripts/upload_document.py — the service-side capability it drove no longer exists.
  • Corrected 24 → 23 concrete Tool endpoints.

Completeness

  • Added a "Contracts and limits" section to both READMEs (EN/ZH kept structurally identical): the 12 stable error codes with HTTP mapping, the two API key access modes, the special handling of account/usage Tools and document.result.get, idempotency semantics and per-protocol header names, request body limits, and the three metered Tools with units and caps.
  • Documented the GET /v1/tools response shape.
  • Listed the valid usage.history service filter values and protocol values.

Unit prices are deliberately not published here; the docs say they are provided with the API key.

Drift prevention

  • Added .github/catalog.json, a snapshot of the live capability contract (verified field-by-field against the Gateway's api/mcp-tools.json: 9 endpoints, 23 Tools, all matching).
  • Extended validate_skills.py to fail when any Markdown file mentions a Tool ID, MCP Tool name, or /mcp/* endpoint that is absent from the snapshot.

This last part is the root-cause fix. The previous validator only checked frontmatter and directory names, which is why the document_upload removal went unnoticed.

Verification

  • python .github/scripts/validate_skills.py passes.
  • Negative test: reinserting document_upload, document.upload, and /mcp/document-upload into the README makes the validator fail on all three; removing them restores a pass.
  • The README REST Tool list diffs identically against the Gateway's OpenAPI ToolID enum.
  • All JSON code blocks in both READMEs parse.

🤖 Generated with Claude Code

sugus-d and others added 3 commits August 5, 2026 17:44
The Gateway removed document.upload and made document.parsing accept
HTTPS URL input only, but the public docs still documented the upload
session flow. Following them produced 404 TOOL_NOT_FOUND on
/v1/tools/document.upload/call and INVALID_ARGUMENTS for uploadId.

- Drop document_upload / document.upload from both README tables and
  document the required fileUrl + fileName body.
- Rewrite the document-parsing Skill and Tool Reference around URL-only
  input, including the HTTPS, length, and no-userinfo constraints.
- Delete scripts/upload_document.py; the service side no longer exists.
- Correct the endpoint count from 24 to 23, matching the live catalog
  and the OpenAPI ToolID enum.

Co-Authored-By: Claude <noreply@anthropic.com>
…drift

The public docs described the happy path only, so integrators had no
authoritative list of failure codes, no request size limits, and no
statement of how restricted keys and metered Tools behave.

- Add contract sections to both READMEs: the 12 stable error codes with
  their HTTP mapping, the two API key access modes, the special handling
  of account/usage Tools and document.result.get, idempotency semantics
  and header names per protocol, request body limits, and the three
  metered Tools with their units and caps.
- Document the GET /v1/tools response shape.
- List the valid usage.history service filter values and the protocol
  values in the account-usage Tool Reference.
- Add .github/catalog.json, a snapshot of the live capability contract,
  and extend validate_skills.py to reject any documented Tool ID, MCP
  Tool, or MCP endpoint missing from it. This is what would have caught
  the document.upload drift automatically.

Co-Authored-By: Claude <noreply@anthropic.com>
The abbreviated example used empty objects for input_schema and
output_schema, which hid the fact that discovery returns complete JSON
Schemas. Fill in a real input schema, note that name is the MCP Tool
name, and mark the elided output schema explicitly.

Co-Authored-By: Claude <noreply@anthropic.com>
@sugus-d
sugus-d merged commit 56c301f into main Aug 5, 2026
2 checks passed
@sugus-d
sugus-d deleted the docs/align-url-only-document-parsing branch August 5, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant