> For the complete documentation index, see [llms.txt](https://anyint.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://anyint.gitbook.io/docs/features/tool-calling.md).

# tool calling

AnyInt supports tool-oriented workflows through provider-compatible patterns rather than one universal internal schema.

## Current documented patterns

| Pattern                                                 | Best for                                                      |
| ------------------------------------------------------- | ------------------------------------------------------------- |
| OpenAI-style `tools` flows in OpenAI-compatible clients | agent frameworks and existing OpenAI-based loops              |
| Gemini-native `tools.functionDeclarations`              | Gemini-native integrations that want exact provider semantics |

## Gemini-native example

```bash
curl https://gateway.api.anyint.ai/v1beta/models/gemini-2.0-flash:generateContent \
  -H "Authorization: Bearer $ANYINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          {"text": "What is the temperature in London?"}
        ]
      }
    ],
    "tools": [
      {
        "functionDeclarations": [
          {
            "name": "get_current_temperature",
            "description": "Gets the current temperature for a given location.",
            "parameters": {
              "type": "object",
              "properties": {
                "location": {
                  "type": "string",
                  "description": "The city name, e.g. San Francisco"
                }
              },
              "required": ["location"]
            }
          }
        ]
      }
    ]
  }'
```

## Practical guidance

* keep tool names stable and descriptive
* validate every tool argument before execution
* return tool results in a shape the model can consume reliably
* log both the tool request and tool result for debugging

## How to choose a pattern

* If your application already uses an OpenAI agent loop, stay on the OpenAI-compatible side
* If you are building around Gemini-native tools, use the Gemini route directly
* Do not mix request shapes across provider families inside one call path
