<span id="读取插件技能文件"></span>

# Read a plugin skill file

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Read the selected plugin skill's entry file or a file within its package.

```text
GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/plugin-discovery/skill
```

<span id="调用前准备"></span>

## Before you call this API

Prepare the target Workspace ID and a personal access token that can access the resources and perform this operation. Use the actual resource identifier for `workspace_id` in the path, and also supply the Workspace ID in `X-Workspace-ID`. See [Shared objects and inputs](objects.md#input-identifiers) for environment variable sources.

<span id="查询参数"></span>

## Query parameters

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Request example

```bash
curl -X GET "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/plugin-discovery/skill" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  --get \
  --data-urlencode "ref=$CAPABILITY_REF"
```

:::::
:::::{tab-item} Parameters

Only skill capabilities can be read. Paths must remain within the skill root and cannot use ../. Content returns as a JSON string, not a download URL. Reading an instruction file does not execute its commands.

| Fields | Type | Required | Description |
| --- | --- | --- | --- |
| `ref` | string | Yes | Skill capability_ref returned by search. |
| `path` | string | No | Package path relative to the skill root. Omit to read the skill entry file. |

:::::
::::::
:::::::

<span id="成功响应"></span>

## Successful response

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": 0,
  "data": {
    "content": "# 示例技能\n"
  }
}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `code` | integer | 0 on success. |
| `data` | object | Data returned by this operation. |
| `data.content` | string | Text of the selected skill file. |

:::::
::::::
:::::::

<span id="错误响应"></span>

## Error response

Handle numeric business-error `code`, `message`, and `details.reason` separately from authorization-layer string codes. See [Errors and states](objects.md#error-responses). On a state or version conflict, read the current resource first; do not automatically change identifiers or retry writes.
