Skip to main content

ToolCallContent

Tool/function call request from the LLM.
from adaline_api.models.tool_call_content import ToolCallContent

Fields

modality
str
required
Must be "tool-call".
index
int
required
Zero-based index of the tool call. Minimum: 0.
id
str
required
Unique identifier for this tool call.
name
str
required
Name of the function to call.
arguments
str
required
JSON-encoded string of function arguments.
server_name
str | None
Optional MCP server name. Aliased as serverName in JSON.

Example

import json
from adaline_api.models.tool_call_content import ToolCallContent
from adaline_api.models.message_content import MessageContent

tool_call = ToolCallContent(
    modality="tool-call",
    index=0,
    id="call_abc123",
    name="get_weather",
    arguments=json.dumps({"city": "San Francisco", "units": "fahrenheit"})
)

content = MessageContent(actual_instance=tool_call)
JSON:
{
  "modality": "tool-call",
  "index": 0,
  "id": "call_abc123",
  "name": "get_weather",
  "arguments": "{\"city\":\"San Francisco\",\"units\":\"fahrenheit\"}"
}