# Query skill details

Read the skills in the current workspace. When the workspace to which the skill belongs is not specified, the service will first check the current workspace; if it is not found and the current workspace is not the system workspace, it will then search for the system skill with the same ID.

```text
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/skills/{skill_id}
```

## Before you call

First [query the skill list](list-skills.md) to obtain the skill ID. Prepare a personal access token and target workspace ID that has 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 `X-Workspace-ID` Header.
- `$SKILL_ID`: The skill ID to be queried.

## Request example

```bash
curl "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/skills/$SKILL_ID" \
  -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. |
| `skill_id` | string | Yes | The skill ID to be queried. |

## Query parameters

| Parameters | Type | Is it required | Description |
| --- | --- | --- | --- |
| `skill_workspace_id` | string | No | The workspace to which the skill belongs; can only be the current workspace or `system`. When this parameter is provided, only the specified directory is queried. |

## Successful response

Returns `200` and the skill's complete definition on success.

```json
{
  "code": 0,
  "data": {
    "id": "skill_01",
    "workspace_id": "ws_01",
    "name": "摘要技能",
    "description": "总结输入内容。",
    "status": "active",
    "source_type": "custom",
    "instruction": {
      "body": "总结用户提供的内容。"
    },
    "requirements": {
      "tool_refs": ["tool_01"]
    },
    "version": 2,
    "created_at": "2026-01-02T15:04:05Z",
    "updated_at": "2026-01-03T10:00:00Z"
  }
}
```

The response fields are as follows.

| Field | Type | Description |
| --- | --- | --- |
| `code` | integer | `0` on success. |
| `data.id` | string | Skill ID and the workspace to which it belongs; the workspace of the system skill is `system`. |
| `data.workspace_id` | string | Skill ID and the workspace to which it belongs; the workspace of the system skill is `system`. |
| `data.name` | string | Basic information and status of the skill. |
| `data.description` | string | Basic information and status of the skill. |
| `data.status` | string | Basic information and status of the skill. |
| `data.source_type` | string | Source type and source reference. |
| `data.source_ref` | string | Source type and source reference. |
| `data.instruction` | object | Summary of commands and routes. |
| `data.routing_summary` | object | Summary of commands and routes. |
| `data.requirements` | object | Required skills, tools, knowledge base roles, file input, and model capabilities. |
| `data.parameters_schema` | object | Input Schema and output convention. |
| `data.output_contract` | object | Input Schema and output convention. |
| `data.version` | integer | Current skill version. |

## Error response

```json
{
  "code": 2,
  "message": "<错误信息>"
}
```

### Common HTTP errors

```{list-table}
:header-rows: 1
:widths: 12 22 32 34

* - HTTP status code
  - error code
  - Common causes
  - Recommended actions
* - `400`
  - `2`（`INVALID_ARGUMENT`）
  - Invalid path parameter or `skill_workspace_id`.
  - Check skill ID and workspace scope.
* - `401`
  - `6`（`UNAUTHENTICATED`）
  - Lack of valid identity credentials.
  - Check API Key.
* - `403`
  - `5`（`PERMISSION_DENIED`）
  - The current identity does not have permission to read skills.
  - Check workspace authorization.
* - `404`
  - `3`（`NOT_FOUND`）
  - This skill does not exist in the current or rollback system directories.
  - Check the skill ID, or provide `skill_workspace_id` explicitly.
* - `503`
  - `15`（`UNAVAILABLE`）
  - Skill services or authorized dependencies are temporarily unavailable.
  - Try again later.
```

## Follow-up operations

When modifications are needed [Update skills](update-skill.md). When returning to the list [Query skill list](list-skills.md).
