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.
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¶
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 |
|---|---|---|---|
|
string |
Yes |
The workspace ID corresponding to the RuntimeGrant. |
|
string |
Yes |
Target agent ID. |
Request body
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Fixed to 2.0. |
|
string or number |
No |
The JSON-RPC request ID generated by the caller. The response echoes this value. |
|
string |
Yes |
tools/list or tools/call. |
|
object |
No |
method parameters. tools/list only accepts omitted, null or empty objects. |
|
string |
tools/call is |
The name of the tool to be called. The name returned by tools/list must be used. |
|
object |
No |
Tool input. |
|
string |
No |
The caller’s ID associated with this tool call. |
|
object |
No |
Protocol metadata. |
Successful response¶
{
"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:
{
"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 |
|---|---|---|
|
string |
Fixed to 2.0. |
|
string or number or null |
Corresponds to the JSON-RPC ID in the request. |
|
array of object |
The tools returned by tools/list are allowed to be called. |
|
string |
Tool ID. |
|
string |
The name of the tool that can be called. params.name must be passed unchanged when calling. |
|
string |
Tool type. Does not return if not set. |
|
string |
Tool description. Does not return if not set. |
|
string |
Classification of tool side effects. |
|
object |
Input and output JSON Schema. Does not return if not set. |
|
object |
Input and output JSON Schema. Does not return if not set. |
|
object |
MCP protocol metadata. Only returned if provided by the server. |
|
array of object |
Results for clients consuming only text content. |
|
object |
The machine-readable result of tools/call. |
|
string |
Tool call ID. |
|
string |
The actual tool ID called. |
|
object |
Tool output. |
|
object |
Call metadata. Returns if present. |
|
array |
Call the generated product. Returns if present. |
|
string |
The call result creation time. Returns if present. |
Error response¶
{
"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 |
|---|---|---|
|
|
The request body cannot be parsed, |
|
|
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. |
|
|
The credentials required to call the tool are not available. Recommendation: Check the configuration of credentials required by runtime tasks and tools. |
|
|
The request body exceeds the gateway allowed size. Suggestion: Make the request body smaller. |
|
|
Tool is not supported. Recommendation: Call |
|
|
An unclassified error occurred in the gateway or tool execution. Suggestion: Record the request ID and error message and try again. |
|
|
MCP gateway not configured. Recommendation: Try again later, or check the runtime deployment. |