Look up an API operation
Returns what the GunSpec API reference documents for an endpoint: its parameters and accepted values, the plan it needs, whether a key is required, caching, every error status with the error.reason values to branch on, and the languages a sample is printed in. Use this tool before writing or explaining code that calls the GunSpec API, instead of recalling parameters. The path may be a template (/v1/firearms/{id}), a concrete path or a URL; a partial path such as /v1/vendor lists the operations under it.
Example usage
- 1
A person asks
- What parameters does the GunSpec endpoint for a single firearm take, and what errors can it return?
- 2
The assistant calls the tool
tools/calljson{ "name": "gunspec_api_operation", "arguments": { "path": "/v1/firearms/{id}", "method": "GET" }} - 3
The server answers
Resultjson{ "matched": "exact", "specVersion": "1.1.0", "operations": [ { "method": "GET", "path": "/v1/firearms/{id}", "title": "Get Firearm", "description": "Returns the full specification for a single firearm, including its manufacturer, category, calibers, images, and known users.", "tier": "builder", "auth": "required", "cacheable": true, "docsUrl": "https://docs.gunspec.io/en/api/firearms/detail", "parameters": [ { "name": "id", "in": "path", "type": "string", "required": true, "description": "Resource slug ID", "accepts": null, "default": null, "minimum": null, "maximum": null }, { "name": "If-None-Match", "in": "header", "type": "string", "required": false, "description": "The `ETag` from a previous response. If the body would be byte-identical, the API answers `304 Not Modified` with no body. A 304 counts toward the per-minute rate limit but not the daily request allowance.", "accepts": null, "default": null, "minimum": null, "maximum": null } ], "requestBody": null, "success": { "status": 200, "contentType": "application/json" }, "errors": [ { "status": 400, "message": "Validation error", "code": "VALIDATION_ERROR", "reasons": [ "INVALID_PARAMETER", "INVALID_JSON", "INVALID_REQUEST" ] }, { "status": 401, "message": "API key required", "code": "UNAUTHORIZED", "reasons": [ "AUTH_REQUIRED", "KEY_MISSING", "KEY_INVALID" ] }, { "status": 403, "message": "Valid key, not permitted", "code": "FORBIDDEN", "reasons": [ "PLAN_REQUIRED", "ACCOUNT_SUSPENDED", "KEY_ON_HOLD" ] } ], "notes": [ "Requires an API key with **Builder** tier or higher.", "`alternateNames`, `firingModes`, `safetyMechanisms`, `features`, `feedSystems`, `sources`, `conflicts` and `productionNumbers` are arrays and objects, not strings. They were served as JSON text and had to be parsed by the caller; a cell tha…", "`conflicts` contains objects with `name`, `years`, and `sides` (array of belligerent strings)." ], "sampleLanguages": [ "curl", "javascript", "python" ], "sdk": [ { "typescript": "client.firearms.get(id)", "python": "client.firearms.get(id: str)" } ] } ]}Captured from the live API on Oct 22, 2026. Lists and long text are shortened for display.
Related references
Arguments
- stringrequired
The endpoint path, e.g. "/v1/firearms/{id}", "/v1/firearms/glock-g17" or a full URL.
- Sent as
- ?path=
- string
HTTP method, when the path answers more than one.
- Accepts
- Sent as
- ?method=
Each argument is sent to GET /v1/docs/operations as the parameter shown, so the same request can be made to the API directly, with your key, if you want to shape what comes back.