mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-12-05 18:59:29 +08:00
fix: using-services 先认出本 Agent 已接入的 MCP 服务端 / Recognize this Agent's own MCP servers before the catalog (#292)
## 中文
用户直接点名一个服务(如「用 xxx 这个服务」)时,这个服务常常就是本 Agent 已接入的 MCP 服务端。`using-services`
1.0.4 只讲如何查全局「应用与服务」目录,模型会先去目录和市场里找,绕一大圈才回到自己的 MCP 工具。
更新至 1.1.0:
- 描述把适用范围写在最前:本 Agent 已接入的 MCP 服务端不用本技能,按服务端 ID 用 `ToolCatalog`
检索其工具。技能目录只显示描述开头,三段描述都在 80 token 以内,能整段显示。
- 新增 Step 0:先看系统提示词里是否列出本轮可用的 MCP 服务端(较新的客户端才有,写成条件句);用
`ToolCatalog(query="<服务端 ID>")` 检索,检索不支持 `<ID>__*`
这类通配;工具名与加载方式以结果为准;不为确认接入情况去读配置文件或配置接口,因为 MCP 配置里的环境变量和请求头可能含明文凭据。
- Step 4 第 3 条改写:接入后工具注册为 `<serverId>__<工具名>`,名字不合规时模型看到的是改写后的名字,不要按习惯猜。
- 不写死加载工具的名字,也不设客户端下限:按服务端 ID 用 `ToolCatalog`
检索、按结果给出的方式加载,在现有各版本客户端上都成立。
- 同步目录元数据(描述、版本、更新日期);英文改为人工维护并刷新 `source_hash`,避免被自动翻译覆盖。
验证:中英标题数一致(15/15);`source_hash` 按 `scripts/i18n/translate.py`
的同一算法复算;`git diff --check` 通过;对改动做了语义审阅,无客户、伙伴或其他私有标识。本机没有 uv,目录与 i18n
校验以本 PR 的 CI 为准;私有词表的公开信息扫描未在本机运行。客户端 seed 将在本 PR
合入后单独更新。客户端侧配套改动(自我认知列出本轮的 MCP 服务端、`ToolCatalog` 按服务端 ID 整段命中)在
DesireCore 主仓单独提交,本技能不依赖它。
## English
When a user names a service ("use the xxx service"), it is often one of
this Agent's own MCP servers. `using-services` 1.0.4 only explained how
to search the global Apps & Services catalog, so the model searched the
catalog and marketplace first and took a long detour before reaching its
own MCP tools.
Version 1.1.0:
- The description now states the scope up front: this Agent's own MCP
servers do not need this skill; search `ToolCatalog` by the server ID
instead. The skill catalog shows only the start of a description, and
all three descriptions are under 80 tokens, so they are shown in full.
- New Step 0: check whether the system prompt lists this turn's MCP
servers (only newer clients have it, so the step is conditional); search
`ToolCatalog(query="<server ID>")`, which has no wildcard such as
`<ID>__*`; use the tool names and load method from the result; do not
read config files or config endpoints to confirm, because MCP
environment variables and headers may hold plaintext credentials.
- Step 4, item 3 rewritten: connected tools are registered as
`<serverId>__<toolName>`, and the model sees a rewritten name when that
breaks naming rules, so do not guess names.
- No hard-coded loader tool name and no minimum client version:
searching `ToolCatalog` by server ID and loading as the result says
holds on all current client versions.
- Catalog metadata synchronized (descriptions, version, date); English
is now human-maintained with a refreshed `source_hash`, so automatic
translation does not overwrite it.
Validation: heading counts match (15/15); `source_hash` recomputed with
the same algorithm as `scripts/i18n/translate.py`; `git diff --check`
passed; changes reviewed semantically with no customer, partner or other
private identifiers. uv is not installed locally, so catalog and i18n
validation rely on this PR's CI; the private-token public-information
scan was not run locally. The client seed will be updated in a separate
PR after this merges. The companion client change (self-awareness lists
this turn's MCP servers; `ToolCatalog` matches a whole server ID) goes
to the DesireCore main repository separately; this skill does not depend
on it.
This commit is contained in:
3 files changed
+62
-16
No files matched your search
@@ -2,11 +2,11 @@
|
||||
license: "MIT"
|
||||
name: using-services
|
||||
description: >-
|
||||
Discover and invoke HTTP/MCP services already registered in the global
|
||||
catalog. Use when the user asks the Agent to call an API, search for an
|
||||
existing service, or query a backend that was registered via the
|
||||
registering-services skill. 调用某个 API、查找已有服务、访问已注册的后端服务时使用。
|
||||
version: 1.0.4
|
||||
Find and call HTTP/MCP services registered in the global Apps & Services
|
||||
catalog, or connect a catalog MCP service to this Agent. For an MCP server
|
||||
this Agent already has, skip this skill and search ToolCatalog by the server
|
||||
ID. 调用目录里登记的 API、查找本 Agent 尚未接入的现成服务时使用。
|
||||
version: 1.1.0
|
||||
type: meta
|
||||
risk_level: low
|
||||
status: enabled
|
||||
@@ -19,7 +19,7 @@ tags:
|
||||
- meta
|
||||
metadata:
|
||||
author: desirecore
|
||||
updated_at: '2026-09-18'
|
||||
updated_at: '2026-11-17'
|
||||
i18n:
|
||||
default_locale: en-US
|
||||
source_locale: zh-CN
|
||||
@@ -30,17 +30,17 @@ metadata:
|
||||
name: 使用服务
|
||||
short_desc: 发现并调用全局目录中已注册的服务
|
||||
description: >-
|
||||
发现并调用全局应用与服务目录中已经注册过的 HTTP/MCP 服务。Use when 用户让 Agent 调用某个 API、查找已有服务,或访问通过 registering-services 注册的后端。
|
||||
查找并调用全局「应用与服务」目录里登记的 HTTP/MCP 服务,或把其中的 MCP 服务接入本 Agent;本 Agent 已接入的 MCP 服务端不用本技能,按服务端 ID 用 ToolCatalog 检索其工具。Use when 用户要调用目录里的 API 或找尚未接入的现成服务。
|
||||
body: ./SKILL.zh-CN.md
|
||||
translated_by: human
|
||||
en-US:
|
||||
name: Using Services
|
||||
short_desc: Discover and invoke registered services from the catalog
|
||||
description: >-
|
||||
Discover and invoke HTTP/MCP services already registered in the global catalog. Use when the user asks the Agent to call an API, search for an existing service, or query a backend that was registered via the registering-services skill.
|
||||
Find and call HTTP/MCP services registered in the global Apps & Services catalog, or connect a catalog MCP service to this Agent. For an MCP server this Agent already has, skip this skill and search ToolCatalog by the server ID. Use when the user asks to call an API from the catalog or to find an existing service this Agent has not connected yet.
|
||||
body: ./SKILL.md
|
||||
translated_by: ai:chatgpt
|
||||
source_hash: sha256:b841f1996c1d428f
|
||||
translated_by: human
|
||||
source_hash: sha256:1ed16897ea44ed91
|
||||
market:
|
||||
icon: >-
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="9" width="6" height="6" rx="1.5"/><rect x="15" y="3" width="6" height="6" rx="1.5"/><rect x="15" y="15" width="6" height="6" rx="1.5"/><path d="M9 11.5h3.5V6H15"/><path d="M9 12.5h3.5V18H15"/></svg>
|
||||
@@ -83,9 +83,37 @@ exists; this meta-skill is the fallback for ad-hoc discovery.
|
||||
- The user gives you a one-off URL to fetch — use `HttpRequest` directly
|
||||
- You already have the per-service `svc-<id>` Skill activated — follow it
|
||||
instead, it's more specific
|
||||
- The named service is already one of this Agent's MCP servers — find its
|
||||
tools as in Step 0; no catalog lookup is needed
|
||||
|
||||
## L2: How to discover and call
|
||||
|
||||
### Step 0 — Check whether it is already one of this Agent's MCP servers
|
||||
|
||||
A service the user names ("use the xxx service") may already be one of this
|
||||
Agent's MCP servers; the server ID is the name it was connected under. Then no
|
||||
catalog lookup is needed:
|
||||
|
||||
1. If the system prompt lists the MCP servers available this turn (only newer
|
||||
clients have that section), check there first; a missing section does not
|
||||
mean the server is not connected.
|
||||
2. Search `ToolCatalog` by the server ID, for example
|
||||
`ToolCatalog(query="<server ID>", max_results=20)`. Put only the ID itself in
|
||||
the query, not a wildcard such as `<ID>__*`: the search has no wildcards and
|
||||
would find nothing. If the number of results equals `max_results`, there may
|
||||
be more; raise it and search again.
|
||||
3. Once found, use the tool names in the result; do not build names from the
|
||||
naming pattern (see Step 4, item 3). If the result marks a tool as not
|
||||
declared yet, load it the way the result says and call it from the next model
|
||||
request on; if what you find is the server's authentication tool, complete
|
||||
authentication as its description says first. You are done with this skill
|
||||
at that point.
|
||||
4. Only if nothing is found, look up the catalog from Step 1.
|
||||
|
||||
Confirm the connection only in the ways above; do not read this Agent's config
|
||||
file or config endpoints for it: the environment variables and headers in MCP
|
||||
config may hold plaintext credentials.
|
||||
|
||||
### Step 1 — List the catalog
|
||||
|
||||
Fetch the registry:
|
||||
@@ -159,7 +187,13 @@ the Agent's `mcp_servers` config:
|
||||
1. If you haven't added the MCP service to your Agent yet, POST to
|
||||
`http://127.0.0.1:<agent-service-port>/api/agents/<your-id>/mcp-servers` with `{ serverId: '<service.id>', config: <connection> }`
|
||||
2. Next query, MCP discovery will auto-expose tools from the server
|
||||
3. Call the tools by their MCP-declared names directly
|
||||
3. Once connected, the tools are registered in this Agent's tool pool as
|
||||
`<serverId>__<toolName>`; when that name breaks the model API's character or
|
||||
length rules, the model sees a different, rewritten name. Do not guess call
|
||||
names from the remote declaration or the naming pattern: search `ToolCatalog`
|
||||
by the server ID as in Step 0 and use the names in the result; for tools the
|
||||
result marks as not declared, load them the way the result says before
|
||||
calling.
|
||||
|
||||
### Step 5 — Handle the response
|
||||
|
||||
|
||||
Reference in new issue
Block a user