---
title: "Invoke a tool on an MCP script connection"
method: POST
path: "/api/script-connections/{id}/mcp-call"
tags: ["Script Connections"]
---

# Invoke a tool on an MCP script connection

`POST /api/script-connections/{id}/mcp-call`

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `tool` string, required
  - `arguments` object

## Response `200`

MCP call result

- union
  - object
    - `ok` true, required
    - `result` object, required
      - `content` object[], required
        - `type` string, required
        - `text` string
      - `isError` boolean
  - object
    - `ok` false, required
    - `error` union, required
      - object
        - `code` number
        - `message` string
        - `data` unknown
      - string

## Other responses

- `400` — Invalid MCP connection or request
- `403` — Not allowed to invoke this MCP connection
- `404` — Script connection or agent not found

## Changes

- **2026-08-07** `06cac6a7c5bc` — 4 info
  - added the media type `application/json` for the response with the status `200`
  - added the media type `application/json` for the response with the status `400`
  - added the media type `application/json` for the response with the status `403`
  - added the media type `application/json` for the response with the status `404`
- **2026-07-09** `4f56890cc278` — 1 info
  - endpoint added
- **2026-07-02** `0c910612f9ac` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/changes/api/script-connections/:id/mcp-call/post.md)

---

[API](https://skmtc.dev/desplega-ai/apis/agent-swarm-api.md) · [All operations](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/desplega-ai/agent-swarm-api/revisions/8cde933218b5/schema)
