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

# Invoke an MCP tool

> Executes the MCP tool identified by `toolName` with the key-value `args` map provided in the request body.

The OAuth token is forwarded to the tool for user-scoped operations.

Returns the tool's result in `data`.



## OpenAPI

````yaml post /mcp/tools/{toolName}
openapi: 3.1.0
info:
  title: HERO API
  version: current
  description: |-
    The HERO REST API.

    See https://developers.myhero.so for the rendered docs.
servers:
  - url: https://app.myhero.so
security: []
paths:
  /mcp/tools/{toolName}:
    post:
      tags:
        - MCP
      summary: Invoke an MCP tool
      description: >-
        Executes the MCP tool identified by `toolName` with the key-value `args`
        map provided in the request body.


        The OAuth token is forwarded to the tool for user-scoped operations.


        Returns the tool's result in `data`.
      operationId: mcpInvokeTool
      parameters:
        - schema:
            type: string
            minLength: 1
          required: true
          name: toolName
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                args:
                  type: object
                  additionalProperties: {}
              default: {}
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data: {}
        '400':
          description: 400 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
        '401':
          description: 401 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
        '403':
          description: 403 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
      security:
        - oauth2: []
components:
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://app.myhero.so/oauth/authorize
          tokenUrl: https://app.myhero.so/oauth/token
          scopes: {}

````