TTMSMCPErrorCode Enumeration
Error codes reported back to a caller when a request cannot be answered. The first five are the standard JSON-RPC codes; the remaining ones are application-defined codes in the range the specification reserves for server implementations.
API unit family: TMS.MCP.Helpers
Remarks
A failing tool call is deliberately not reported through these codes. An unknown tool name, or an exception escaping a tool method, comes back as a normal tools/call result whose isError member is True and whose content carries the message, which is what the protocol specification asks for.
Members
| Name | Description |
|---|---|
ecParseError = -32700 |
Code -32700. The received text is not valid JSON and could not be parsed. Also raised while a tool serializes itself when a hand-written input schema supplied by its schema-generation handler does not parse as JSON. |
ecInvalidRequest = -32600 |
Code -32600. The text parsed as JSON but is not a well-formed call: the protocol member is missing or is not 2.0, the method is absent, a notification carried an identifier, or a batch was empty or held an entry that is not an object. |
ecMethodNotFound = -32601 |
Code -32601. No handler is registered for the requested method, or the capability behind it is switched off. An inbound sampling/createMessage request is answered this way while EnableSampling is False. |
ecInvalidParams = -32602 |
Code -32602. The parameters are missing or have the wrong shape: no parameter object at all, no tool name on a call, no resource URI, no prompt name, a required prompt argument left out, or an argument value that does not match its declared type. |
ecInternalError = -32603 |
Code -32603. The selected handler could not run: the callback behind a tool, prompt or resource is not assigned, a return value could not be converted to JSON, or an unexpected exception escaped the dispatcher. An inbound sampling request that arrives while no sampling handler is assigned is reported this way. |
ecServerNotInitialized = -32000 |
Code -32000. The request arrived before the initialization handshake completed, so no protocol version has been negotiated yet. Every request-handling method checks this first. |
ecUnknownTool = -32001 |
Code -32001. Reserved for an unrecognized tool name. It is declared for completeness but never raised: a call naming a tool that does not exist returns an ordinary result whose isError member is True rather than a protocol-level error. |
ecResourceNotFound = -32002 |
Code -32002. No resource and no resource template matches the requested URI. The task methods reuse the same code for an unknown task identifier, including one that belongs to another session, so a caller cannot probe for tasks it does not own. |
ecPromptNotFound = -32003 |
Code -32003. A prompts/get request named a prompt that is not in the prompt collection. |
ecOperationFailed = -32004 |
Code -32004. The request reached its handler and the handler then failed: reading a resource raised or returned nothing, or building a prompt raised. A tool method that raises produces this code internally, but the call path catches it and turns it into an isError result instead of returning it to the caller. |
ecURLElicitationRequired = -32042 |
Code -32042. Reserved for a request that cannot proceed until the user has completed an out-of-band elicitation opened through a URL. It is declared for completeness but never raised. |