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

# Call a tool

> Calls an enabled tool synchronously and returns its JSON output directly.
Requires the `environment:tools:call` scope.


Calls an enabled tool synchronously and returns its output directly. See [Tools](https://nango.dev/docs/guides/functions/tools.md) for an end-to-end example.

> [!NOTE]
>
> Requires a Nango Environment API key with `environment:tools:call`. [Learn more about API key scopes](https://nango.dev/docs/reference/backend/http-api/api-keys.md#scopes).


## OpenAPI

````yaml POST /connections/{connectionId}/tools/{name}/calls
openapi: 3.1.0
info:
  title: Nango API
  description: Nango API specs used to authorize & sync data with external APIs.
  version: 1.0.0
servers:
  - url: https://api.nango.dev
    description: Production server
  - url: http://localhost:3003
    description: Local server
security:
  - bearerAuth: []
externalDocs:
  url: https://nango.dev/docs/reference/backend/http-api/authentication
paths:
  /connections/{connectionId}/tools/{name}/calls:
    post:
      summary: Call a tool
      description: >
        Calls an enabled tool synchronously and returns its JSON output
        directly.

        Requires the `environment:tools:call` scope.
      operationId: callTool
      parameters:
        - name: connectionId
          in: path
          required: true
          schema:
            type: string
          description: The connection ID to execute the tool for.
        - name: name
          in: path
          required: true
          schema:
            type: string
          description: The tool name on the integration.
        - name: Provider-Config-Key
          in: header
          required: false
          schema:
            type: string
          description: >-
            Integration ID. Required when multiple integrations share the
            connection ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                input:
                  description: >-
                    Input matching the tool's schema. Omit for tools that take
                    no input.
            example:
              input:
                owner: NangoHQ
                repo: interactive-demo
                title: Bug report
      responses:
        '200':
          description: The tool's JSON output, returned directly without a data wrapper.
          content:
            application/json:
              schema: {}
        '400':
          description: >-
            Invalid request, invalid tool input, invalid invocation, or
            ambiguous connection ID. Supply Provider-Config-Key to disambiguate.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Missing permissions or function disabled during invocation.
        '404':
          description: Connection or enabled tool not found.
        '500':
          description: Tool execution failed or a server error occurred.
components:
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StdError'
  schemas:
    StdError:
      type: object
      additionalProperties: false
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - code
          properties:
            code:
              type: string
            message:
              type: string
            errors:
              type: array
              items:
                type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An Environment API key from your Nango environment, or an Account API
        key for account-level endpoints.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.