Called from MCP client

List or call the tools allowed for the current task through the MCP HTTP entry of the specified agent. This interface must use a task-scoped RuntimeGrant. A personal access token cannot replace this credential.

HTTP
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/agents/{agent_id}/mcp/http

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare a RuntimeGrant that matches the current runtime task, as well as the workspace ID and agent ID in the path. Personal access tokens are not a replacement for RuntimeGrant.

Request body

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/agents/$AGENT_ID/mcp/http" \
  -H "Authorization: Bearer $RUNTIME_GRANT" \
  -H 'Content-Type: application/json' \
  -d '{
    "jsonrpc": "2.0",
    "id": "<REQUEST_ID>",
    "method": "tools/list"
  }'

Only one Authorization: Bearer <RUNTIME_GRANT> request header is submitted. JSON-RPC requests do not accept unknown top-level fields.

Path parameters

Field

Type

Required

Description

workspace_id

string

Yes

The workspace ID corresponding to the RuntimeGrant.

agent_id

string

Yes

Target agent ID.

Request body

Field

Type

Required

Description

jsonrpc

string

Yes

Fixed to 2.0.

id

string or number

No

The JSON-RPC request ID generated by the caller. The response echoes this value.

method

string

Yes

tools/list or tools/call.

params

object

No

method parameters. tools/list only accepts omitted, null or empty objects.

params.name

string

tools/call is

The name of the tool to be called. The name returned by tools/list must be used.

params.arguments

object

No

Tool input.

params.call_id

string

No

The caller’s ID associated with this tool call.

params._meta

object

No

Protocol metadata.

Successful response

JSON
{
  "jsonrpc": "2.0",
  "id": "req_01",
  "result": {
    "tools": [
      {
        "id": "tool_01",
        "name": "tool_01",
        "kind": "function",
        "description": "查询销售数据",
        "side_effect_class": "read",
        "input_schema": {
          "type": "object"
        }
      }
    ]
  }
}

Returns 200 and a JSON-RPC response on success. tools/list Only tools allowed by the current RuntimeGrant are returned. structuredContent of tools/call is the machine-readable result of the call.

Examples of successful results for tools/call are as follows:

JSON
{
  "jsonrpc": "2.0",
  "id": "req_01",
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"call_id\":\"call_01\",\"tool_id\":\"tool_01\",\"output\":{}}"
      }
    ],
    "structuredContent": {
      "call_id": "call_01",
      "tool_id": "tool_01",
      "output": {},
      "created_at": "2026-08-18T01:00:00Z"
    }
  }
}

Some tool errors that can be corrected by the model still return 200 and are marked as true in result.isError. Please read result.content and correct the tool parameters.

Field

Type

Description

jsonrpc

string

Fixed to 2.0.

id

string or number or null

Corresponds to the JSON-RPC ID in the request.

result.tools

array of object

The tools returned by tools/list are allowed to be called.

result.tools[].id

string

Tool ID.

result.tools[].name

string

The name of the tool that can be called. params.name must be passed unchanged when calling.

result.tools[].kind

string

Tool type. Does not return if not set.

result.tools[].description

string

Tool description. Does not return if not set.

result.tools[].side_effect_class

string

Classification of tool side effects.

result.tools[].input_schema

object

Input and output JSON Schema. Does not return if not set.

result.tools[].output_schema

object

Input and output JSON Schema. Does not return if not set.

result.tools[]._meta

object

MCP protocol metadata. Only returned if provided by the server.

result.content

array of object

Results for clients consuming only text content.

result.structuredContent

object

The machine-readable result of tools/call.

result.structuredContent.call_id

string

Tool call ID.

result.structuredContent.tool_id

string

The actual tool ID called.

result.structuredContent.output

object

Tool output.

result.structuredContent.metadata

object

Call metadata. Returns if present.

result.structuredContent.artifacts

array

Call the generated product. Returns if present.

result.structuredContent.created_at

string

The call result creation time. Returns if present.

Error response

JSON
{
  "jsonrpc": "2.0",
  "id": "req_01",
  "error": {
    "code": -32602,
    "message": "invalid params"
  }
}

MCP gateway error using JSON-RPC error object.

Common HTTP errors

HTTP status code

error code

Description

400

-32700、-32600、-32601、-32602

The request body cannot be parsed, jsonrpc is not 2.0, the method is not supported, or the request parameters, tool name, or tool input are invalid. Recommendation: Check JSON-RPC requests. tools/list Do not pass in non-null parameters.

401

-32001

The RuntimeGrant is missing, invalid, expired, rejected, or does not match the workspace in the path. Recommendation: Use an unexpired RuntimeGrant that matches the workspace.

401

-32003

The credentials required to call the tool are not available. Recommendation: Check the configuration of credentials required by runtime tasks and tools.

413

-32600

The request body exceeds the gateway allowed size. Suggestion: Make the request body smaller.

422

-32002

Tool is not supported. Recommendation: Call tools/list first and only call the returned tool.

500

-32000

An unclassified error occurred in the gateway or tool execution. Suggestion: Record the request ID and error message and try again.

503

-32002

MCP gateway not configured. Recommendation: Try again later, or check the runtime deployment.

Last updated on