Query resource binding

Read the agent’s effective tools, skills, knowledge base and channel bindings, and return the parsed model and running provider information.

GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/agents/{agent_id}/bindings

Preparation before calling

First query the agent list to obtain the agent ID. Prepare the personal access token, target workspace ID, and agent ID that have access to the target workspace.

The example below uses:

  • $AI_STUDIO_API_KEY: The actual personal access token, passed through the X-API-Key Header.

  • $WORKSPACE_ID: Target workspace ID, passed through the X-Workspace-ID Header and as workspace_id in the path.

  • $AGENT_ID: The agent ID to query, as agent_id in the path.

Request example

curl "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/agents/$AGENT_ID/bindings" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Path parameters

Parameters

Type

Is it required

Description

workspace_id

string

Yes

The current workspace ID.

agent_id

string

Yes

The agent ID to be queried.

Query parameters

Parameters

Type

Is it required

Description

agent_workspace_id

string

No

Workspace where the agent definition belongs. Use workspace_id from the same agent-list item; if omitted, the current workspace is used.

Successful response

Returns 200 on success. warnings means that some binding references failed to resolve, but does not mean that the entire read request failed. When there are no warnings, the field may be omitted and should be treated as an empty list.

{
  "code": 0,
  "data": {
    "workspace_id": "ws_01",
    "agent_workspace_id": "ws_01",
    "agent_id": "agent_01",
    "agent_version": 2,
    "runtime": {
      "provider": "matrixone",
      "profile": "default"
    },
    "model": {
      "model_config_ref": "mc_01"
    },
    "tools": [],
    "skills": [],
    "knowledge_bases": [],
    "channel_bindings": [],
    "warnings": []
  }
}

The response fields are as follows.

Field

Type

Description

code

integer

0 on success.

data.workspace_id

string

ID of the workspace where the call is made.

data.agent_workspace_id

string

The workspace ID to which the agent definition belongs.

data.agent_id

string

Agent ID and resource version.

data.agent_version

integer

Agent ID and resource version.

data.runtime

object

The parsed running target and model configuration.

data.model

object

The parsed running target and model configuration.

data.provider

object

The parsed running provider configuration.

data.tools

array

Various parsed resource bindings. Each item can include the resource ID, belonging workspace, category, status, and configuration.

data.skills

array

Various parsed resource bindings. Each item can include the resource ID, belonging workspace, category, status, and configuration.

data.knowledge_bases

array

Various parsed resource bindings. Each item can include the resource ID, belonging workspace, category, status, and configuration.

data.channel_bindings

array

Channel capability range and channel instance IDs available within this range.

data.warnings

array of string

Unresolved resource reference descriptions; returned only when warnings exist.

[] after a type denotes an array. [] in a field path denotes each item in an array.

Error response

{
  "code": 3,
  "message": "<错误信息>"
}

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

2(INVALID_ARGUMENT)

Invalid path parameter or agent_workspace_id.

Check path and query parameters.

401

6(UNAUTHENTICATED)

Lack of valid identity credentials.

Check API Key.

403

5(PERMISSION_DENIED)

The current caller does not have permission to read the agent.

Check the agent authorization in the workspace.

404

3(NOT_FOUND)

The agent or its running provider configuration does not exist.

Check the agent ID, belonging workspace and run target.

503

15(UNAVAILABLE)

The agent resource service or its authorized dependencies are temporarily unavailable.

Try again later.

Follow-up operations

When the binding range needs to be adjusted, Update resource binding; when the model needs to be changed, Update model binding.

Last updated on