agent-swarm.devagent-swarm.dev

Scripts

Author, search, and run reusable TypeScript scripts — a shared automation catalog callable across swarm agents and workflows

POST
/api/mcp-bridge

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "http://localhost:3013/api/mcp-bridge" \  -H "Content-Type: application/json" \  -d '{    "tool": "string"  }'
Empty
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/scripts

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Query Parameters

scope?string
Value in"global" | "agent"
includeScratch?string
Value in"true" | "false"

Response Body

application/json

application/json

curl -X GET "http://localhost:3013/api/scripts"
{
  "scripts": [
    {
      "id": "string",
      "name": "string",
      "scope": "global",
      "scopeId": "string",
      "description": "string",
      "intent": "string",
      "version": 0,
      "isScratch": true,
      "typeChecked": true,
      "fsMode": "none",
      "createdByAgentId": "string",
      "createdAt": "string",
      "updatedAt": "string"
    }
  ]
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/scripts/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string
Formatuuid

Response Body

application/json

application/json

curl -X GET "http://localhost:3013/api/scripts/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "script": {
    "id": "string",
    "name": "string",
    "scope": "global",
    "scopeId": "string",
    "source": "string",
    "description": "string",
    "intent": "string",
    "signatureJson": "string",
    "contentHash": "string",
    "version": 0,
    "isScratch": true,
    "typeChecked": true,
    "fsMode": "none",
    "createdByAgentId": "string",
    "createdAt": "string",
    "updatedAt": "string",
    "signature": {
      "argsType": "string",
      "resultType": "string",
      "description": "string"
    },
    "argsJsonSchema": {
      "property1": null,
      "property2": null
    },
    "created_by": "string",
    "updated_by": "string"
  }
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/scripts/{id}/apis

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string
Formatuuid

Response Body

application/json

application/json

curl -X GET "http://localhost:3013/api/scripts/497f6eca-6276-4993-bfeb-53cbbbba6f08/apis"
{
  "apis": [
    {
      "id": "string",
      "scriptId": "string",
      "agentId": "string",
      "authMode": "none",
      "enabled": true,
      "label": "string",
      "callCount": 0,
      "lastUsedAt": "string",
      "createdAt": "string"
    }
  ]
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
POST
/api/scripts/{id}/apis

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "http://localhost:3013/api/scripts/497f6eca-6276-4993-bfeb-53cbbbba6f08/apis" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "scriptId": "string",
  "agentId": "string",
  "authMode": "none",
  "enabled": true,
  "label": "string",
  "callCount": 0,
  "lastUsedAt": "string",
  "createdAt": "string",
  "token": "string"
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
DELETE
/api/scripts/{id}/apis/{endpointId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string
Formatuuid
endpointId*string

Response Body

application/json

application/json

curl -X DELETE "http://localhost:3013/api/scripts/497f6eca-6276-4993-bfeb-53cbbbba6f08/apis/string"
{
  "deleted": true
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
PATCH
/api/scripts/{id}/apis/{endpointId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string
Formatuuid
endpointId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PATCH "http://localhost:3013/api/scripts/497f6eca-6276-4993-bfeb-53cbbbba6f08/apis/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "scriptId": "string",
  "agentId": "string",
  "authMode": "none",
  "enabled": true,
  "label": "string",
  "callCount": 0,
  "lastUsedAt": "string",
  "createdAt": "string"
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
POST
/api/scripts/{id}/apis/{endpointId}/rotate

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string
Formatuuid
endpointId*string

Response Body

application/json

application/json

application/json

curl -X POST "http://localhost:3013/api/scripts/497f6eca-6276-4993-bfeb-53cbbbba6f08/apis/string/rotate"
{
  "id": "string",
  "scriptId": "string",
  "agentId": "string",
  "authMode": "none",
  "enabled": true,
  "label": "string",
  "callCount": 0,
  "lastUsedAt": "string",
  "createdAt": "string",
  "token": "string"
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/scripts/{id}/apis/{endpointId}/secret

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string
Formatuuid
endpointId*string

Response Body

application/json

application/json

curl -X GET "http://localhost:3013/api/scripts/497f6eca-6276-4993-bfeb-53cbbbba6f08/apis/string/secret"
{
  "token": "string"
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/scripts/{id}/versions

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

id*string
Formatuuid

Response Body

application/json

application/json

curl -X GET "http://localhost:3013/api/scripts/497f6eca-6276-4993-bfeb-53cbbbba6f08/versions"
{
  "versions": [
    {
      "id": "string",
      "scriptId": "string",
      "version": 0,
      "source": "string",
      "description": "string",
      "intent": "string",
      "signatureJson": "string",
      "contentHash": "string",
      "changedByAgentId": "string",
      "changedAt": "string",
      "changeReason": "string",
      "created_by": "string",
      "updated_by": "string"
    }
  ]
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
DELETE
/api/scripts/{name}

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

name*string
Length1 <= length <= 200

Query Parameters

scope?string
Default"agent"
Value in"global" | "agent"

Response Body

application/json

application/json

application/json

application/json

curl -X DELETE "http://localhost:3013/api/scripts/string"
{
  "deleted": true
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/scripts/{name}/types

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Path Parameters

name*string
Length1 <= length <= 200

Query Parameters

scope?string
Value in"global" | "agent"

Response Body

application/json

application/json

curl -X GET "http://localhost:3013/api/scripts/string/types"
{
  "signature": {
    "argsType": "string",
    "resultType": "string",
    "description": "string"
  },
  "argsJsonSchema": {
    "property1": null,
    "property2": null
  },
  "sdkTypes": "string",
  "stdlibTypes": "string"
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
POST
/api/scripts/run

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:3013/api/scripts/run" \  -H "Content-Type: application/json" \  -d '{}'
{
  "result": null,
  "autoSaved": {
    "slug": "string",
    "reason": "string"
  },
  "kvSaved": {
    "namespace": "string",
    "key": "string"
  },
  "truncated": {
    "stdout": true,
    "stderr": true
  },
  "durationMs": 0,
  "stdout": "string",
  "stderr": "string",
  "exitCode": 0,
  "error": "timeout",
  "runtimeError": {
    "name": "string",
    "message": "string",
    "stack": "string",
    "userFrames": [
      {
        "file": "string",
        "line": 0,
        "column": 0,
        "raw": "string"
      }
    ],
    "userScriptLine": 0,
    "userScriptColumn": 0
  }
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
POST
/api/scripts/search

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "http://localhost:3013/api/scripts/search" \  -H "Content-Type: application/json" \  -d '{}'
{
  "results": [
    {
      "name": "string",
      "signature": {
        "argsType": "string",
        "resultType": "string",
        "description": "string"
      },
      "argsJsonSchema": {
        "property1": null,
        "property2": null
      },
      "description": "string",
      "score": 0
    }
  ]
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
GET
/api/scripts/type-defs

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Response Body

application/json

curl -X GET "http://localhost:3013/api/scripts/type-defs"
{
  "sdkTypes": "string",
  "stdlibTypes": "string"
}
POST
/api/scripts/upsert

Authorization

bearerAuth
AuthorizationBearer <token>

API key via Authorization: Bearer <API_KEY>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "http://localhost:3013/api/scripts/upsert" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "source": "string"  }'
{
  "name": "string",
  "version": 0,
  "contentDeduped": true
}
{
  "error": "string",
  "property1": null,
  "property2": null
}
{
  "error": "string",
  "property1": null,
  "property2": null
}