You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ccc0838
Browse filesBrowse the repository at this point in the historyBrowse files
docs(ai): teach the qualified action tool name on the AI pages (#39321)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg6QH4oAzb3iViTHPkq3LwzC)_Fixes#39289
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:写 AI 技能的作者在四篇 AI
文档里看到动作工具的新拼法(对象名加两个下划线再加动作名),示例也改成新拼法;产品行为不变。
- 为什么做:属于 AI 能力的文档与平台一致;平台早已按对象区分动作工具名,文档仍教旧拼法,作者照抄会一次匹配所有同名动作。
- 出错会怎样:只是文档文字,最坏是某句说法不准,作者写出的旧拼法仍能解析;可直接撤回本次合并。
- 要你做什么:无。
## What changes
Four hand-written pages under `content/docs/ai/` (`tools.mdx`,
`agents.mdx`, `actions-as-tools.mdx`, `connect-mcp.mdx`) now teach the
tool name an AI-exposed Action materialises as:
- each page says once, in one short paragraph where it first shows the
tool name, that an object-bound Action's tool is `action_OBJECT__ACTION`
and a top-level Action's is `action_ACTION`; that a qualified name over
64 characters is shortened, with `actionToolName` from
`@objectstack/spec/ai` as the way to get the exact spelling; that the
older `action_ACTION` spelling of an object-bound Action still resolves,
to every exposed Action of that name; and that `action_*` still means
every exposed Action;
- every example that names an object-bound Action's tool uses the
qualified spelling (`action_support_case__escalate_case`,
`action_crm_lead__convert_lead`, `action_support_case__resolve_case`,
`action_crm_lead__lookup_company` / `action_crm_lead__enrich_contact`);
- the generic mentions elsewhere use the qualified spelling or "action
tools", rather than repeating the paragraph. No new sections.
Every sentence was checked against
`packages/spec/src/ai/action-tool-name.ts` (the two spellings, the
64-character limit and the head-plus-hash shortening,
`legacyActionToolName` resolving to every action of that name) and
`packages/lint/src/validate-ai-tool-references.ts` (both spellings in
the resolvable universe, the trailing wildcard) on `main` at dc4a2cd.
`actionToolName` is exported from the `@objectstack/spec/ai` entry
(`packages/spec/src/ai/index.ts` re-exports `./action-tool-name`;
`package.json` exports `./ai`). The MCP door sentences were checked
against `bindingEntryServed` in `packages/mcp/src/skill-prompts.ts`: any
entry starting with `action_` is served by `run_action`, so both
spellings are.
## Tests
Docs-only. The `os:check` blocks that changed (`tools.mdx`) type-check
under `check:skill-examples` (green, below).
## Acceptance notes
- `tools.mdx` still quotes the `stack.tools` field description, which
says "materialised action_NAME tools". That block is a verbatim quote of
`packages/spec/src/stack.zod.ts`, so it is left as quoted; the paragraph
under the example gives the qualified rule. Changing the spec
description is outside this card's file surface.
- Out of scope per the card: the lint's near-miss suggestion offering
only the old spelling (routed to #38951).
- No changeset: no published package ships `content/docs/**` (no
`files[]` entry names it), so the PR carries `skip-changeset`.
## Verification
Read first: the rule paragraph in `content/docs/ai/tools.mdx` under the
first example, then the same paragraph in `agents.mdx`.
Two-minute check: grep the four pages for the old generic spelling
(`action_` followed by `name` in angle brackets); on this head it hits
only the quoted spec description at `tools.mdx` line 22.
<details><summary>Local gates at 0901922</summary>
`node scripts/pm/dispatch-gates.mjs --commands` derived 46 commands for
the four paths; all 46 exited 0 on this head (the lint/spec/client
builds were run first for the five gates that read built output).
`--ran` reconciliation: 46 derived, 46 run, 0 NOT-MEASURED, 0 UNRUN.
`overlap-check.mjs --pr=39304`: origin/main and #39304 merge cleanly.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CZyaZyJWdzKPF2U7EQ)_
Co-authored-by: Claude <noreply@anthropic.com>
Three things decide whether `action_<name>` exists, and `os validate` checks
234
+
An object-bound Action's tool is `action_<object>__<action>` (the object
235
+
name, two underscores, the action name), and a top-level Action's, bound to no
236
+
object, is `action_<action>`. A qualified name longer than 64 characters is
237
+
shortened to its head plus a hash, so take the exact spelling from
238
+
`actionToolName` in `@objectstack/spec/ai` rather than writing a long one by
239
+
hand. The older `action_<action>` spelling of an object-bound Action still
240
+
resolves, but to every exposed Action of that name, whatever its object.
241
+
`action_*` keeps its meaning: every exposed Action.
242
+
243
+
Three things decide whether an Action's tool exists, and `os validate` checks
235
244
all three (`ai-skill-tool-unresolved`):
236
245
237
246
| Requirement | Why |
@@ -268,9 +277,10 @@ itself (a different LLM-facing description, fewer exposed parameters).
268
277
when the server it is installed on lists every tool the skill binds, read from
269
278
that server's own tool list when the prompt request is answered. A plain name is
270
279
served by a tool of that name, a trailing wildcard (`describe_*`) by any listed
271
-
tool it matches, and an `action_<name>` entry (or `action_*`) also by
272
-
`run_action`. A skill that binds no tool is offered as before, and `prompts/get`
273
-
answers a withheld skill as it answers an unknown prompt name. This holds on the
280
+
tool it matches, and any entry that starts with `action_` (`action_*`
281
+
included) also by `run_action`. A skill that binds no tool is offered as
282
+
before, and `prompts/get` answers a withheld skill as it answers an unknown
283
+
prompt name. This holds on the
274
284
HTTP endpoint and on any host that drives its own MCP server and calls
275
285
`registerSkillPrompts`, stdio included; the plugin's own long-lived stdio
276
286
server, which projects skills through `MCPServerRuntime.bridgePrompts` instead,
@@ -335,7 +345,7 @@ own `ask` / `build` records use exactly these fields):
335
345
|`instructions`| System prompt / prime directives |
336
346
|`model`| Model config: `model` (the model name, optional — absent means the deployment's default model), `temperature`, `maxTokens`, `topP`. There is no `provider`: it was **removed in protocol 19 (#37712)** because no runtime read it — the deployment's AI settings choose the provider, and resolve the model name among the providers they turn on |
337
347
|`skills`| Skill names to attach (the primary Agent → Skill → Tool capability model) |
338
-
|`tools`|**Removed in protocol 17 (#3894)** — the key is not on the type, so a `defineAgent({ … })` literal that sets it fails `tsc` as an excess property, and the strict schema refuses it at parse as an unknown key, naming the [upgrade guide](https://objectstack.ai/docs/protocol-upgrade). This is **not** a rename: there is no key the value moves to. Declare each tool on a **skill** instead — a platform tool by its registered name, or `action_<name>` for one of your own AI-exposed Actions — and attach that skill through `skills` (ADR-0064) |
348
+
|`tools`|**Removed in protocol 17 (#3894)** — the key is not on the type, so a `defineAgent({ … })` literal that sets it fails `tsc` as an excess property, and the strict schema refuses it at parse as an unknown key, naming the [upgrade guide](https://objectstack.ai/docs/protocol-upgrade). This is **not** a rename: there is no key the value moves to. Declare each tool on a **skill** instead — a platform tool by its registered name, or `action_<object>__<action>` (`action_<action>` when top-level) for one of your own AI-exposed Actions — and attach that skill through `skills` (ADR-0064) |
339
349
|`knowledge`|**Removed in protocol 17 (#3896)** — the key is not on the type, so a `defineAgent({ … })` literal that sets it fails `tsc` as an excess property, and the strict schema refuses it at parse as an unknown key, naming the [upgrade guide](https://objectstack.ai/docs/protocol-upgrade). Declaring `sources` / `indexes` here never scoped retrieval: `search_knowledge` takes `sourceIds` from the LLM's own tool-call arguments, not from the agent record, so an author who “scoped” access here scoped nothing. This is **not** a rename: there is no key the value moves to — delete the block. Restrict retrieval at the knowledge-service / source level (per-source permissions), and describe intended grounding in `instructions` so the model asks for the right sources |
340
350
341
351
There is no `type` field and no fixed agent "type" taxonomy — behaviour comes from
@@ -398,7 +408,7 @@ Always be professional and data-driven.`,
398
408
},
399
409
400
410
// Capability comes from skills — the only tool-bearing slot (ADR-0064).
401
-
// Each skill names the platform tools and `action_<name>` tools it needs.
411
+
// Each skill names the platform tools and `action_<object>__<action>` tools it needs.
402
412
// (There is no agent-level `knowledge` block — it was removed in protocol
403
413
// 17 (#3896 close-out): declaring sources never scoped retrieval. Restrict
404
414
// access at the knowledge-service/source level; describe intended
@@ -464,9 +474,9 @@ Use reputable data sources.`,
464
474
maxTokens: 1000,
465
475
},
466
476
467
-
// The enrichment Flows are exposed with `ai.exposed`, so the runtime
468
-
//materialises `action_lookup_company` / `action_enrich_contact` for the
469
-
// skill to name.
477
+
// The enrichment Flow actions on `crm_lead` are exposed with `ai.exposed`,
478
+
//so the runtime materialises `action_crm_lead__lookup_company` /
479
+
//`action_crm_lead__enrich_contact` for the skill to name.
Copy file name to clipboardExpand all lines: content/docs/ai/tools.mdx
+18-7Lines changed: 18 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ differs is where that name comes from:
34
34
| What you want the agent to do | How you get there | Tool record? |
35
35
|:---|:---|:---|
36
36
| Read, query, aggregate, or search — what the platform already does for every app | Name the **platform tool** in your skill: `query_records`, `get_record`, `aggregate_data`, `search_knowledge`, `describe_object`, … |**No**|
37
-
| Run something your app already does — a `script` / `api` / `flow` Action | Opt the Action in with `ai.exposed` + `ai.description`; the runtime materialises one `action_<name>` tool per exposed Action and your skill names that. See [Actions as Tools](/docs/ai/actions-as-tools). |**No**|
37
+
| Run something your app already does — a `script` / `api` / `flow` Action | Opt the Action in with `ai.exposed` + `ai.description`; the runtime materialises one `action_<object>__<action>` tool per exposed Action (`action_<action>` for a top-level one) and your skill names that. See [Actions as Tools](/docs/ai/actions-as-tools). |**No**|
38
38
| Reach a system outside your app | Connect it over MCP — see [Connect an MCP Client](/docs/ai/connect-mcp)|**No**|
39
39
| Present an executable to the model *differently* from the way your app runs it | A `tool` record — the optional refinement layer described below |**Yes**, and rarely |
0 commit comments