---
title: "Create tool call"
method: POST
path: "/tool-calls"
tags: ["Tool Calls"]
---

# Create tool call

`POST /tool-calls`

## Request

- Base URL: `https://api.metorial.com`
- URL: `https://api.metorial.com/tool-calls`
- Auth: HTTP bearer

Creates a new tool call in a session by invoking a specific tool.

## Headers

- `Metorial-Version` string

## Request body

- BodyRequest80
  - `tool_id` string, required: The ID of the tool to call
  - `input` object, required: Input data to pass to the tool
  - `metadata` object: Optional metadata for the tool call
  - `session_id` string, required: The ID of the session to which this tool call belongs

## Response `200`

Successful response

- ToolCall
  - `object` 'session.tool_call', required: String representing the object's type
  - `id` string, required: Unique tool call identifier
  - `tool_key` string, required: The key identifying the tool that was called
  - `type` 'tool_call' | 'mcp_control' | 'mcp_message' | 'unknown', required: The type of the tool call
  - `status` 'waiting_for_response' | 'failed' | 'succeeded', required: Current status of the tool call
  - `source` 'client' | 'provider', required: Source of the tool call
  - `transport` 'tool_call' | 'mcp' | 'metorial_protocol' | 'system', required: Transport protocol used
  - `session_id` string, required: Parent session ID
  - `message_id` string, required: Associated session message ID
  - `session_provider_id` string, nullable, required: Session provider ID
  - `connection_id` string, nullable, required: Session connection ID
  - `provider_run_id` string, nullable, required: Provider run ID
  - `sender_participant` object, nullable, required
    - `object` 'session.participant', required: String representing the object's type
    - `id` string, required: Unique session participant identifier
    - `type` 'unknown' | 'provider' | 'agent' | 'system', required: Participant type
    - `identifier` string, required: Participant identifier
    - `name` string, required: Display name
    - `data` Data, required: Participant payload data
      - `identifier` string, required: Participant-specific identifier within the payload
      - `name` string, required: Participant-specific display name within the payload
    - `provider_id` string, nullable, required: Provider ID if associated
    - `connection_type` 'mcp' | 'metorial_protocol' | 'tool_call', nullable, required
    - `agent_id` string, nullable, required
    - `agent_instance_id` string, nullable, required
    - `identity_actor_id` string, nullable, required
    - `identity_id` string, nullable, required
    - `agent_actor_id` string, nullable, required
    - `agent_client_id` string, nullable, required
    - `consumer_id` string, nullable, required
    - `created_at` string, date-time, required: Timestamp when created
  - `responder_participant` object, nullable, required
    - `object` 'session.participant', required: String representing the object's type
    - `id` string, required: Unique session participant identifier
    - `type` 'unknown' | 'provider' | 'agent' | 'system', required: Participant type
    - `identifier` string, required: Participant identifier
    - `name` string, required: Display name
    - `data` Data, required: Participant payload data
      - `identifier` string, required: Participant-specific identifier within the payload
      - `name` string, required: Participant-specific display name within the payload
    - `provider_id` string, nullable, required: Provider ID if associated
    - `connection_type` 'mcp' | 'metorial_protocol' | 'tool_call', nullable, required
    - `agent_id` string, nullable, required
    - `agent_instance_id` string, nullable, required
    - `identity_actor_id` string, nullable, required
    - `identity_id` string, nullable, required
    - `agent_actor_id` string, nullable, required
    - `agent_client_id` string, nullable, required
    - `consumer_id` string, nullable, required
    - `created_at` string, date-time, required: Timestamp when created
  - `tool` Tool, required
    - `object` 'provider.tool', required: String representing the object's type
    - `id` string, required: Unique tool identifier
    - `key` string, required: Tool key
    - `name` string, required: Display name of the tool
    - `description` string, nullable, required: Tool description
    - `capabilities` object, required: Tool capabilities
    - `constraints` string[], required: Tool constraints
    - `instructions` string[], required: Tool usage instructions
    - `input_schema` object, nullable, required
      - `type` 'json_schema', required
      - `schema` object, required: JSON Schema defining the tool input parameters
    - `output_schema` object, nullable, required
      - `type` 'json_schema', required
      - `schema` object, required: JSON Schema defining the tool output format
    - `tags` object, nullable, required
      - `destructive` boolean, nullable, required: Whether the tool is destructive
      - `read_only` boolean, nullable, required: Whether the tool is read-only
    - `tool_category_keys` string[], required: Keys of the tool categories this tool belongs to
    - `specification_id` string, required: Specification ID
    - `provider_id` string, required: Provider ID
    - `created_at` string, date-time, required: Timestamp when created
    - `updated_at` string, date-time, required: Timestamp when last updated
  - `error` object, nullable, required
    - `object` 'session.error', required: String representing the object's type
    - `id` string, required: Unique session error identifier
    - `code` string, required: Error code
    - `message` string, required: Error message
    - `data` object, required: Error payload data
    - `status` 'processing' | 'processed', required: Indicates whether the error is still being processed or has been fully processed and grouped.
    - `session_id` string, required: Parent session ID
    - `provider_run_id` string, nullable, required: Provider run ID
    - `connection_id` string, nullable, required: Connection ID
    - `group_id` string, nullable, required: Error group ID
    - `similar_error_count` number, required: Count of similar errors in the group
    - `created_at` string, date-time, required: Timestamp when created
  - `input` object, nullable, required: Input data passed to the tool call. Bodies larger than 16 KB in list responses, or larger than 1 MB when retrieving by ID, are replaced with a session.message.omitted_body object.
  - `output` object, nullable, required: Output data returned from the tool call. Bodies larger than 16 KB in list responses, or larger than 1 MB when retrieving by ID, are replaced with a session.message.omitted_body object.
  - `created_at` string, date-time, required: Timestamp when created

## Other responses

- `400`: Invalid parameters or action
- `401`: Missing or invalid API key
- `403`: The key lacks permission for this resource
- `404`: No such resource
- `422`: Validation failed
- `429`: Rate limit exceeded
- `500`: Unexpected server error

---

[API](https://skmtc.dev/metorial/apis/metorial-api.md) - [All operations](https://skmtc.dev/metorial/apis/metorial-api/llms.txt) - [OpenAPI document](https://skmtc.dev/metorial/apis/metorial-api/revisions/10ccc89f3eac?raw)
