# Function tools

Describe functions, inspect structured calls, execute only authorized actions in your application, and return matching results.

## Own the complete loop.

The model proposes a call. Your application validates it and decides whether to execute it.

- Send a function name, optional description and JSON parameters; omit the unsupported strict flag.
- Read `message.tool_calls` and validate function names and arguments before acting.
- Execute under your client's own permission policy.
- Return the assistant tool-call message and a `role: tool` message with the same `tool_call_id`.
- Bound model turns, outputs, concurrency and permissions.

## Concrete call and result.

The complete custom-agent example uses this function with a three-file read allow-list.

### Call request

```json
{"model":"<model-id>","messages":[{"role":"user","content":"Read README.md and summarize the setup."}],"tools":[{"type":"function","function":{"name":"read_project_file","description":"Read an allow-listed public project file.","parameters":{"type":"object","properties":{"file":{"type":"string"}},"required":["file"],"additionalProperties":false}}}],"tool_choice":"auto","max_tokens":1024}
```

### Result message

```json
{"role":"tool","tool_call_id":"call_123","content":"# Blaschke ..."}
```

## Protocol boundaries.

Valid request syntax does not guarantee reliable model selection or valid arguments.

**Tool limits**

| Item | Limit |
| --- | --- |
| Definitions | 1–64 |
| Calls per assistant history message | 8 |
| Function name | 1–128 characters |
| Description | 16,384 characters |
| Encoded arguments | 32,768 characters |
| Tool choice | auto, none, required or named function |

## Related guides

- [Build a custom agent](https://beta.blaschkelabs.com/docs/agents/build): Run and test the full source.

Source: https://beta.blaschkelabs.com/docs/tools

Markdown: https://beta.blaschkelabs.com/docs/md/tools.md
