# Agent tools and MCP

Source: https://docs.autessa.com/docs/features/agent-tools-mcp

> Give any AI agent Autessa tools (search, Drive, SMS, email, approvals, and your company's own tools) as JSON Schema tool definitions or through an MCP server.

# Agent tools and MCP

One list of ready-to-use tools for any agent. Fetch them as JSON Schema tool definitions for your model, or connect the Autessa MCP server. Each tool runs with your key's permissions.

Autessa already runs an MCP server for agents built in Autessa; see [MCP servers](/docs/guide/agentic/mcp-servers.md).

## When to use it

- Your agent runs outside Autessa and needs search, messaging, or approvals.
- You built tools in Autessa and want other agents (Claude, Cursor, your own code) to call them.
- You want one permission and firewall check for every tool call, wherever the agent runs.

## Quickstart

1. [Get a free API key](https://builder.autessa.com/get-api-key). New accounts get $100 of free credits for your first month, no card needed. This developer key works for this feature; see [Keys](/docs/start/keys.md).
2. List tools: `GET /clients/agent-tools?include=builtin,tenant`.
3. Pass the tools to your model. When it calls one, run `POST /clients/agent-tools/{name}/invoke`.

**curl:**

```bash
curl "https://api.autessa.com/clients/agent-tools?include=builtin,tenant" \
  -H "Authorization: $AUTESSA_API_KEY"
```

**Python:**

```python
# pip install anthropic requests
import os
import anthropic
import requests

API = "https://api.autessa.com/clients/agent-tools"
H = {"Authorization": os.environ["AUTESSA_API_KEY"]}

tools = requests.get(API, params={"include": "builtin,tenant"}, headers=H, timeout=30).json()["tools"]
claude_tools = [{"name": t["name"], "description": t["description"], "input_schema": t["inputSchema"]} for t in tools]

client = anthropic.Anthropic()
messages = [{"role": "user", "content": "Find our refund policy and text the summary to +12065550100."}]
while True:
    reply = client.messages.create(model="claude-opus-5-5", max_tokens=4096, tools=claude_tools, messages=messages)
    messages.append({"role": "assistant", "content": reply.content})
    calls = [b for b in reply.content if b.type == "tool_use"]
    if not calls:
        break
    results = []
    for call in calls:
        out = requests.post(f"{API}/{call.name}/invoke", headers=H, json={"input": call.input}, timeout=60).json()
        results.append({"type": "tool_result", "tool_use_id": call.id,
                        "content": str(out.get("output")), "is_error": out.get("isError", False)})
    messages.append({"role": "user", "content": results})
print(next(b.text for b in reply.content if b.type == "text"))
```

**TypeScript:**

```typescript
// npm i @anthropic-ai/sdk
import Anthropic from "@anthropic-ai/sdk";

const API = "https://api.autessa.com/clients/agent-tools";
const H = { Authorization: process.env.AUTESSA_API_KEY!, "Content-Type": "application/json" };

const { tools } = await (await fetch(`${API}?include=builtin,tenant`, { headers: H })).json();
const claudeTools = tools.map((t: any) => ({ name: t.name, description: t.description, input_schema: t.inputSchema }));

const client = new Anthropic();
const messages: Anthropic.MessageParam[] = [{ role: "user", content: "What does our travel policy say about hotels?" }];
for (;;) {
  const reply = await client.messages.create({ model: "claude-opus-5-5", max_tokens: 4096, tools: claudeTools, messages });
  messages.push({ role: "assistant", content: reply.content });
  const calls = reply.content.filter((b) => b.type === "tool_use");
  if (!calls.length) break;
  const results = [];
  for (const call of calls) {
    const out = await (await fetch(`${API}/${call.name}/invoke`, {
      method: "POST", headers: H, body: JSON.stringify({ input: call.input }),
    })).json();
    results.push({ type: "tool_result" as const, tool_use_id: call.id, content: JSON.stringify(out.output), is_error: !!out.isError });
  }
  messages.push({ role: "user", content: results });
}
```

**Java:**

```java
var req = java.net.http.HttpRequest.newBuilder(java.net.URI.create(
        "https://api.autessa.com/clients/agent-tools?include=builtin,tenant"))
    .header("Authorization", System.getenv("AUTESSA_API_KEY"))
    .GET()
    .build();
// Each tool has name, description, and inputSchema (JSON Schema) to hand to your model.
System.out.println(java.net.http.HttpClient.newHttpClient()
    .send(req, java.net.http.HttpResponse.BodyHandlers.ofString()).body());
```

## Built-in tools

| Tool | What it does |
| --- | --- |
| `autessadb_search` | Searches an AutessaDB table by meaning. |
| `drive_search` | Searches Drive files by meaning or keywords. |
| `drive_read` | Reads a Drive file's text. |
| `send_sms` | Sends a text message. See [Messaging](/docs/features/messaging.md). |
| `send_email` | Sends an email. |
| `request_approval` | Asks a person to approve. See [Approvals](/docs/features/approvals.md). |
| `get_approval` | Gets the person's decision. |
| `transfer_call` | Transfers a phone call. Phone sessions only. |

Tools you build in Autessa are listed too (`source: "TENANT"`) when the key is allowed to run them.

## Use it through MCP

`@autessa/mcp-tools` serves the same tools as an MCP server, over stdio (the default) or streamable HTTP. `@autessa/mcp-firewall` wraps any other MCP server and checks its tool definitions, every tool call, and every result with the [AI Application Firewall](/docs/features/ai-application-firewall.md). See [MCP integration](/docs/integrations/mcp.md).

```bash
claude mcp add autessa-tools --env AUTESSA_API_KEY="$AUTESSA_API_KEY" -- npx -y @autessa/mcp-tools
```

The server's command is `autessa-mcp-tools`. Options: `--transport stdio|http`, `--port` (default `3333`), `--host` (default `127.0.0.1`), `--include builtin,tenant`, `--allow` and `--deny` (tool names), and `--allow-env-key` (HTTP only). In HTTP mode the server listens at `/mcp`, and each request sends its own Autessa key in the `Authorization` or `X-Autessa-Api-Key` header.

## Libraries and frameworks

| Where | Package | Call |
| --- | --- | --- |
| Python | `autessa-core` | `AgentTools().list()`, `invoke(name, input)` (returns `output` and `is_error`), `run(name, input)` (raises `AgentToolError` on a tool error) |
| TypeScript | `@autessa/core` | `listAgentTools(client)`, `invokeAgentTool(client, name, input)`, `invokeAgentToolRaw(client, name, input)` |
| Java | `com.autessa:autessa-core` | `new AgentTools(client).list()`, `invoke(name, input)`, `call(name, input, sessionId)` |
| LangChain | `langchain-autessa`, `@autessa/langchain` | `AutessaToolkit` |
| Vercel AI SDK | `@autessa/ai-sdk` | `autessaTools({ only, sessionId })` |
| Spring AI | `autessa-spring-boot-starter` | `AutessaToolCallbackProvider`, with `autessa.agent-tools.enabled=true` |

```python
from autessa.core import AgentTools

tools = AgentTools()  # reads AUTESSA_API_KEY
for tool in tools.list():
    print(tool.name, "-", tool.description)
print(tools.run("drive_search", {"query": "refund policy"}))
```

The libraries are in private preview and not yet on PyPI, npm, or Maven Central. Install from GitHub as each library's README describes.

## How it works

- `invoke` takes `input` (matching the tool's `inputSchema`) and an optional `sessionId`. It returns `output` and `isError`.
- Every call uses the same permission checks as running the tool in Autessa.
- When your firewall policy checks tool calls, it checks these calls too.

## Limits

- A key sees only the tenant tools it is allowed to run.
- Per-key rate limits apply. See [API keys and scopes](/docs/start/api-keys.md).

## API reference

[Agent Tools API](/docs/reference/agent-tools.md)

## Benchmarks

Tool-call attacks are covered by [AI Firewall Bench](/docs/benchmarks/ai-firewall-bench.md).

## Example

- [Spring AI bank assistant](https://github.com/Autessa-Inc/autessa-examples/tree/main/examples/spring-ai-bank-assistant): Autessa agent tools (account lookup, help-center search, SMS, email, approvals) as Spring AI tools.
- [Vercel AI chat](https://github.com/Autessa-Inc/autessa-examples/tree/main/examples/vercel-ai-chat): `autessaTools()` gives a Next.js chat `drive_search` and `send_email` with no tool code of your own.
- [MCP firewall for Claude Desktop](https://github.com/Autessa-Inc/autessa-examples/tree/main/examples/mcp-firewall-desktop): `@autessa/mcp-firewall` in front of an MCP server.

## Related

- [MCP integration](/docs/integrations/mcp.md)
- [LangChain integration](/docs/integrations/langchain.md)
- [Vercel AI SDK integration](/docs/integrations/vercel-ai-sdk.md)
- [Tools](/docs/guide/agentic/tools.md)

