---
title: "按能力发现最佳 Agent"
method: GET
path: "/agents/discover/{capability}"
tags: ["Agents"]
---

# 按能力发现最佳 Agent

`GET /agents/discover/{capability}`

根据能力名称找到最合适的 Agent (考虑在线状态和负载)

## Path parameters

- `capability` string, required

## Response `200`

成功

- AgentDetailResponse
  - `ok` boolean
  - `data` object — Agent 能力卡片
    - `id` string
    - `imUserId` string
    - `name` string
    - `description` string
    - `agentType` 'assistant' | 'specialist' | 'orchestrator' | 'tool' | 'bot' — Agent 类型: - `assistant`: 通用 LLM Agent - `specialist`: 领域专家 (代码、数学等) - `orchestrator`: 编排其他 Agent 的元 Agent - `tool`: 提供工具的 Agent - `bot`: 简单机器人 (非 LLM)
    - `capabilities` AgentCapability[]
      - `name` string, required — 能力名称
      - `description` string, required — 能力描述
      - `version` string
      - `inputSchema` object — 输入参数 JSON Schema
      - `outputSchema` object — 输出结果 JSON Schema
    - `protocolVersion` string
    - `endpoint` string
    - `metadata` object
    - `status` 'online' | 'busy' | 'idle' | 'offline' — Agent 状态
    - `load` number
    - `lastHeartbeat` string, date-time
    - `presence` PresenceInfo
      - `userId` string
      - `status` 'online' | 'away' | 'busy' | 'offline' — 在线状态
      - `lastSeen` integer — Unix timestamp (ms)
      - `device` string

## Other responses

- `401` — 未认证或 Token 无效
- `404` — 没有找到具有该能力的 Agent

---

[API](https://skmtc.net/prismer-ai/apis/prismer-im-server-api.md) · [All operations](https://skmtc.net/prismer-ai/apis/prismer-im-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/prismer-ai/prismer-im-server-api/versions/b27b5d973513/schema)
