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

Getting started

Install Agent-Gantry, register your first tools, retrieve only relevant schemas, and execute chosen tool calls safely.

Install

uv add agent-gantry
uv add "agent-gantry[openai,lancedb,nomic,mcp,a2a]"
# pip install agent-gantry also works

1. Create a gantry

from agent_gantry import AgentGantry, set_default_gantry, with_semantic_tools

gantry = AgentGantry()
set_default_gantry(gantry)

2. Register ordinary functions

@gantry.register(tags=["weather", "demo"])
def get_weather(city: str) -> str:
    """Get the current weather for a city."""
    return f"The weather in {city} is 72°F and sunny."

3. Wrap an LLM call

@with_semantic_tools(limit=3, dialect="openai")
async def ask_llm(prompt: str, *, tools=None):
    return await client.chat.completions.create(
        model="gpt-5.5",
        messages=[{"role": "user", "content": prompt}],
        tools=tools,
    )
What happens automatically? Gantry fingerprints registered tools, syncs them to the configured vector store, retrieves semantically relevant definitions, converts schemas to the requested provider dialect, and leaves execution under your control or the Gantry execution engine.

4. Execute a selected tool

from agent_gantry.schema.execution import ToolCall

result = await gantry.execute(ToolCall(
    tool_name="get_weather",
    arguments={"city": "San Francisco"},
))

Next steps