> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gym.scale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Call Tools

> Execute a specific tool with provided arguments

Execute a specific MCP tool with the provided arguments. The tool will run within the isolated session defined by your tags.

<Info>
  Contact Scale to receive Docker images for your environments.
</Info>

## Request Body

<ParamField body="image" type="string" required>
  Docker image identifier for the MCP environment. Contact Scale to obtain the image.
</ParamField>

<ParamField body="tags" type="object" required>
  Session scope tags for data isolation

  <Expandable title="properties">
    <ParamField body="assignmentId" type="string">
      Unique session identifier for data isolation
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="toolName" type="string" required>
  Name of the tool to call (e.g., `add_calendar_event`)
</ParamField>

<ParamField body="toolArguments" type="object" required>
  Arguments to pass to the tool. Structure depends on the specific tool's input schema.
</ParamField>

## Response

<ResponseField name="content" type="array">
  Array of content objects returned by the tool

  <Expandable title="properties">
    <ResponseField name="type" type="string">
      Content type (typically `text`)
    </ResponseField>

    <ResponseField name="text" type="string">
      The text content of the response
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="isError" type="boolean">
  Whether the tool call resulted in an error
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST http://localhost:3004/call-tools \
    -H "Content-Type: application/json" \
    -d '{
      "image": "agent-environment:latest",
      "tags": {"assignmentId": "my-test-session"},
      "toolName": "add_calendar_event",
      "toolArguments": {
        "title": "Team Meeting",
        "start_time": 1735689600,
        "end_time": 1735693200
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "content": [
      {
        "type": "text",
        "text": "Successfully created calendar event 'Team Meeting' with ID: evt_abc123"
      }
    ],
    "isError": false
  }
  ```

  ```json Error Response theme={null}
  {
    "content": [
      {
        "type": "text",
        "text": "Error: Invalid timestamp format. Expected Unix timestamp (integer)."
      }
    ],
    "isError": true
  }
  ```
</ResponseExample>
