Skip to main content

Module tool_surface

Module tool_surface 

Source
Expand description

Budget-aware reduction of tool schemas exposed to clients.

Structs§

SurfaceReduction
Metrics and tool names produced by surface optimization.
ToolSchema
Schema metadata for one client-visible tool.
ToolSurfaceOptimizer
Applies count, token, and lifecycle limits to a tool surface.

Enums§

ToolCategory
Stability tier for a client-visible tool.

Functions§

compress_schema
Returns a compact copy of a tool schema and recalculates its token estimate.
format_reduction_summary
Formats headline surface-reduction metrics for logs and diagnostics.
optimize_for_request
Bridge: optimize MCP tool schemas for the current request profile.
should_optimize_tools
Returns true if tool surface optimization would save significant tokens.
tool_savings_tokens
Returns the token savings from tool surface optimization.