GetAgentSpecLatest - 查询 AgentSpec 最新版本
查询指定 AgentSpec 的最新版本完整内容,用于编辑或查看 latest 版本。
接口说明
请求说明
查询指定 AgentSpec 的最新版本完整内容,用于编辑或查看 latest 版本。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
agentcore:GetAgentSpecLatest |
get |
*AgentSpec
|
无 | 无 |
请求语法
GET /workspaces/{workspaceId}/agent-specs/{agentSpecName}/latest HTTP/1.1
路径参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| workspaceId |
string |
是 |
工作空间 ID |
550e8400-e29b-41d4-a716-446655440000 |
| agentSpecName |
string |
是 |
AgentSpec 名称 |
my-agent |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
当前API无需请求参数
调用“查询 AgentSpec 最新版本”接口时,请按参数定义传入:工作空间 ID、AgentSpec 名称。
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
RestResult |
||
| data |
object |
返回数据。 |
|
| bizTags |
string |
业务标签。 |
示例属性值 |
| content |
string |
内容。 |
示例内容 |
| description |
string |
描述。 |
用于说明资源用途的示例描述。 |
| downloadCount |
integer |
下载次数。 |
10 |
| enable |
boolean |
是否启用。 |
|
| mcpServers |
array<object> |
MCP 服务引用列表。 |
|
|
object |
|||
| name |
string |
名称。 |
agentspec-example |
| name |
string |
名称。 |
agentspec-example |
| resource |
object |
资源文件映射。 |
|
|
object |
资源文件映射中的属性值。 |
||
| content |
string |
内容。 |
示例内容 |
| metadata |
object |
元数据。 |
|
|
any |
元数据中的属性值。 |
示例属性值 |
|
| name |
string |
名称。 |
agentspec-example |
| type |
string |
类型。 |
file |
| scope |
string |
可见范围。 |
PRIVATE |
| skills |
array<object> |
Skill 引用列表。 |
|
|
array<object> |
|||
| name |
string |
名称。 |
agentspec-example |
| sourceType |
string |
Skill 来源类型:REFERENCE 引用 AI Registry、STATIC 随包静态提供 |
REFERENCE |
| versionSelector |
object |
引用的版本选择器,省略时为 LABEL/latest |
|
| type |
string |
版本选择器类型:LABEL 按标签、VERSION 按具体版本 |
LABEL |
| value |
string |
选择器取值:LABEL 时为标签名(如 latest),VERSION 时为具体版本号 |
latest |
| updateTime |
integer |
更新时间,Unix 时间戳,单位为毫秒。 |
1787671022000 |
| requestId |
string |
请求 ID。 |
A1B2C3D4-E5F6-47A8-90AB-CDEF12345678 |
“查询 AgentSpec 最新版本”接口的响应包含:请求 ID、返回数据。
示例
正常返回示例
JSON格式
{
"data": {
"bizTags": "示例属性值",
"content": "示例内容",
"description": "用于说明资源用途的示例描述。",
"downloadCount": 10,
"enable": true,
"mcpServers": [
{
"name": "agentspec-example"
}
],
"name": "agentspec-example",
"resource": {
"key": {
"content": "示例内容",
"metadata": {
"key": "示例属性值"
},
"name": "agentspec-example",
"type": "file"
}
},
"scope": "PRIVATE",
"skills": [
{
"name": "agentspec-example",
"sourceType": "REFERENCE",
"versionSelector": {
"type": "LABEL",
"value": "latest"
}
}
],
"updateTime": 1787671022000
},
"requestId": "A1B2C3D4-E5F6-47A8-90AB-CDEF12345678"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | IllegalRequest | Illegal request: %s. | 非法请求 |
| 400 | InvalidParameter | Parameter error: %s. | 参数错误 |
| 400 | InvalidParameter.ImportFileSize | The import file size exceeds the allowed limit: %s. | 导入文件大小超过限制 |
| 500 | InternalError | An internal error occurred. Please try again later. | 内部异常,请稍后重试;如持续失败,请提供 RequestId 排查 |
| 403 | NoPermission | You are not authorized to perform this operation: %s. | 无操作权限 |
| 404 | AgentSpecNotFound | Not found: %s. | |
| 409 | ResourceAlreadyExist | Resource already exists: %s. | 指定的资源已存在 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。