upsert_canonical_api_definition
Create or update canonical API YAML definitions under .mcp/api/ using replace-file or append-endpoint merge modes. Preview by default, then confirm to write changes.
Instructions
Create or update a canonical YAML under .mcp/api/ only. mergeMode replace_file (requires replaceDefinition) or append_endpoints (requires appendEndpoints). New file on append needs createIfMissing. Default dryRun true returns preview without writing; set dryRun false and confirm true to write (atomic replace + optional .bak backup). Endpoint ids must not collide on append.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | No | ||
| confirm | No | ||
| mergeMode | Yes | ||
| workspaceRoot | No | Optional when MCP_WORKSPACE_ROOT is set. | |
| appendEndpoints | No | Endpoints to append. Each: id, method, path; optional description, headers, params, body | form, auth | digest_auth {username,password}, auth_dependency, auth_retry_on_401, capture {var: jsonPath}, assert {status, jsonPathExists, maxDurationMs, checks[]}, sse {textPath}. | |
| createIfMissing | No | ||
| replaceDefinition | No | Whole definition: version, service, base_url, variables, flows, evals, endpoints[] (same shape as appendEndpoints items). | |
| targetRelativePath | Yes | Path under workspace, must be under .mcp/api/, e.g. .mcp/api/weather/staging.yaml |