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

# Tool use with Agentor

> Use the @function_tool decorator in Agentor to give an agent access to external APIs — schema is generated from your Python function automatically.

**[Agentor](https://github.com/CelestoAI/agentor)** simplifies the [tool use](./overview) process by automatically
generating the tool schema from the function definition, parsing the function signature, and calling the function when required.

To create an Agent with access to external tools or APIs, you need to define a function and decorate it with the `@function_tool` decorator.

```python theme={null}
from agentor import Agentor, function_tool

@function_tool
def get_weather(city: str) -> str:
    """Get the weather of a city"""
    return f"Weather in {city} is sunny"

agent = Agentor(name="Weather Agent", tools=[get_weather])
result = agent.run("What is the weather in London?")
print(result)
```

`agent.run(...)` returns a `RunResult`, and printing it prints the answer:

```markdown theme={null}
Weather in London is sunny.
```

The result also carries the evidence — `result.status`, `result.usage`, and `result.tool_calls` show how the agent got there. See [Monitoring agents](/agentor/guides/observability).

In the next section, we will learn about how to build and use MCP Servers with Agentor.
