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

# Add Tool To Agent

> Add and configure a tool for a specific agent.

**Multi-Level Configuration:**
- **Tenant Level**: API keys, OAuth tokens (shared across all agents)
- **Agent Level**: Tool-specific settings (different per agent)

**How It Works:**
1. Tool connection created at tenant level (if needed)
2. Agent-specific configuration stored separately
3. Different agents can use same tool with different configs

**Example: Google Sheets Tool**
```json
{
  "tool_key": "google_sheets_tool",
  "enabled": true,
  "config": {
    "access_token": "ya29.xxx",        // Tenant level (shared)
    "refresh_token": "1//xxx",         // Tenant level (shared)
    "spreadsheetId": "1BxiMVxxx",     // Agent level (unique per agent)
    "range": "Sheet1!A:Z"              // Agent level (unique per agent)
  }
}
```

**Example: Slack Tool**
```json
{
  "tool_key": "slack_send_message_tool",
  "enabled": true,
  "config": {
    "bot_token": "xoxb-xxx",           // Tenant level (shared)
    "channel": "#agent1-notifications" // Agent level (unique per agent)
  }
}
```

**Result:**
- Agent 1 can log to "Sheet1" with "#support" channel
- Agent 2 can log to "Sheet2" with "#sales" channel  
- Both use same tenant OAuth token



## OpenAPI

````yaml https://api.mrassistant.ai/openapi.json post /tools/agents/{agent_id}/add-tool
openapi: 3.1.0
info:
  title: Backend - Multilingual Voice Agent System
  description: FastAPI backend for multilingual voice agents with tool use
  version: 1.0.0
servers: []
security: []
paths:
  /tools/agents/{agent_id}/add-tool:
    post:
      tags:
        - tools
      summary: Add Tool To Agent
      description: |-
        Add and configure a tool for a specific agent.

        **Multi-Level Configuration:**
        - **Tenant Level**: API keys, OAuth tokens (shared across all agents)
        - **Agent Level**: Tool-specific settings (different per agent)

        **How It Works:**
        1. Tool connection created at tenant level (if needed)
        2. Agent-specific configuration stored separately
        3. Different agents can use same tool with different configs

        **Example: Google Sheets Tool**
        ```json
        {
          "tool_key": "google_sheets_tool",
          "enabled": true,
          "config": {
            "access_token": "ya29.xxx",        // Tenant level (shared)
            "refresh_token": "1//xxx",         // Tenant level (shared)
            "spreadsheetId": "1BxiMVxxx",     // Agent level (unique per agent)
            "range": "Sheet1!A:Z"              // Agent level (unique per agent)
          }
        }
        ```

        **Example: Slack Tool**
        ```json
        {
          "tool_key": "slack_send_message_tool",
          "enabled": true,
          "config": {
            "bot_token": "xoxb-xxx",           // Tenant level (shared)
            "channel": "#agent1-notifications" // Agent level (unique per agent)
          }
        }
        ```

        **Result:**
        - Agent 1 can log to "Sheet1" with "#support" channel
        - Agent 2 can log to "Sheet2" with "#sales" channel  
        - Both use same tenant OAuth token
      operationId: add_tool_to_agent_tools_agents__agent_id__add_tool_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Agent Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              title: Tool Config
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````