> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superwire.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Tool Calling

> Advanced notes for controlled MCP tool access.

Agents do not receive every imported tool automatically. Tool access is explicit through `uses`.

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
tool fetch_task from mcp.tasks.tool.fetch_task

agent researcher {
    model: model.fast
    uses: [tool.fetch_task]
    instruction: "Fetch task context and summarize it."

    output {
        summary: string
    }
}
```

## Workflow-owned calls versus model-owned calls

Use a `call` expression when the workflow author decides exactly which tool to call:

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
dynamic {
    task: call tool.fetch_task {
        bindings {
            task_id: input.task_id
        }
    }
}
```

Use `uses` when the model may decide whether and how to call the tool during the agent step.

## Guardrails

* Add `input` and `output` schemas to tool declarations when possible.
* Use `bindings` for trusted runtime values supplied by the workflow.
* Keep tool names descriptive and scoped to their purpose.
* Include only the tools, prompts, and resources an agent needs.
