Context is precious. Execution is sacred. Trust is earned.Python 3.10–3.13

API reference

Primary imports

from agent_gantry import (
    AgentGantry, create_default_gantry, with_semantic_tools,
    set_default_gantry, ToolCall, ToolResult, ToolDefinition,
    GantryContextProvider, enable_console_logging,
)

AgentGantry

  • register(...): register a callable as a tool, with tags, capabilities, metadata, and schema inference.
  • sync(): synchronize tool definitions to the configured vector store.
  • retrieve(...) / retrieve_tools(...): retrieve relevant tools for a query and return internal or provider-specific schemas.
  • execute(ToolCall): execute a selected call through the execution engine.
  • close(): release vector store, telemetry, and protocol resources.
  • add_mcp_server(MCPServerConfig(command=[...] | url="https://...")): discover tools from a local (stdio) or remote (Streamable HTTP / SSE) MCP server; register_mcp_server(...) registers server metadata for semantic server selection.
  • serve_mcp(transport="stdio" | "http" | "sse", mode="dynamic" | "static" | "hybrid", expose=[...]): expose the registry as an MCP server.
  • add_skills_from_directory(path) / retrieve_skills_as_prompt(query): load Agent Skills (SKILL.md) and inject only the relevant ones per prompt.
  • sync(prune=True): also remove stored tools that are no longer registered.

Decorator path

with_semantic_tools wraps existing async generation functions and injects a tools argument based on the prompt parameter.

CLI

agent-gantry list --module my_app.tools
agent-gantry search "refund an order" --module my_app.tools --limit 3
agent-gantry sync --dry-run --prune --module my_app.tools
agent-gantry serve-mcp --module my_app.tools --transport http --mode hybrid --expose get_weather
agent-gantry install-skill --claude
agent-gantry install-skill --target ./skills

Every inspection command accepts --module pkg.tools[:attr] and then operates on that module's own AgentGantry instance (its embedder, its vector store). Without it a small demo registry is used.