Skip to main content

Module tools

Module tools 

Source
Expand description

The MCP tool layer: typed functions over SharedState plus the registry the server advertises. Transport-agnostic — the rmcp adapter in server.rs and the Admin API’s prompt renderer both call into here.

Modules§

cache
purge_cache – the Admin API’s DELETE /api/cache/{id}, for agents.
catalog
Read tools over static knowledge: node types, vars, status, config export.
config
Read tools over the stored gateway config, plus standalone validation.
debug
Read tools over debug mode: trace listing/inspection and the sandbox.
writes
Write tools. Every mutation builds a full candidate GatewayConfig, then either validates it (dry_run) or commits it through the configured ConfigStore — exactly the path the Admin API takes.

Structs§

ToolDef
Static description of one tool. The MCP tool registry, advertised only by the mcp transport (src/mcp/server.rs) — the Admin API exposes prompts, not tools.
ToolError
A domain failure surfaced to the agent as an MCP tool error (never a JSON-RPC error): {code, message, errors?, hint?}.

Statics§

TOOLS 🔒

Functions§

args
Deserializes tool arguments, reporting schema mismatches as invalid_input.
call
Executes a tool. Scope is not checked here (see server.rs).
parse_payload
Accepts a payload either as a JSON object or as a YAML document in a string — agents naturally write the YAML the docs show.
schema_of
JSON Schema (draft 2020-12, as schemars 1 emits) for a tool’s arguments, with the $schema/title noise removed. Only used to build TOOLS below, which is mcp-only (the Admin API exposes prompts, not tools).
tool_def
Looks up a tool by name.
tool_defs
Every tool, in the order clients see them.

Type Aliases§

JsonObject
A JSON object, as MCP tool arguments arrive.