Documentation
¶
Overview ¶
Package toolschema answers what a registered tool's advertised input schema is, read from the MCP server's own tools/list.
The error contract asks it when a call is refused because its arguments do not match the tool's schema (#2811): the refusal lists the parameters the tool accepts, and only the server knows them for every tool. mcp-trino registers its tools upstream, and a gateway connection's tools come from another server, so no registration helper the platform owns sees them all. The schema read is the one a client is shown, list decorators included, so a parameter the platform injects (session_id, purpose) is listed as accepted, which it is.
The listing is taken on demand over an in-memory session and cached, so a refusal costs one listing at most once per TTL, and a tool added after the last listing (a gateway connection) is found by listing again on a miss.
Index ¶
Constants ¶
const DefaultTTL = time.Minute
DefaultTTL is how long a listing answers before the next lookup lists again.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lookup ¶
type Lookup struct {
// contains filtered or unexported fields
}
Lookup reads input schemas from one server's tools/list.
func New ¶
New returns a lookup over server's listing, cached for ttl (DefaultTTL when zero or negative).
func (*Lookup) InputSchema ¶
InputSchema returns the named tool's advertised input schema as decoded JSON, or nil when the server holds no such tool or cannot be listed. A miss in a fresh listing lists again once, so a tool registered since is found.