Skip to content

Commit 0901922

Browse files
committed
docs(ai): teach the qualified action tool name on the AI pages
Claude-Session: https://claude.ai/code/session_01Utp6CZyaZyJWdzKPF2U7EQ Co-authored-by: Claude <noreply@anthropic.com>
1 parent dc4a2cd commit 0901922

4 files changed

Lines changed: 66 additions & 26 deletions

File tree

‎content/docs/ai/actions-as-tools.mdx‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,20 @@ the caller's identity forwarded.
3535

3636
<Callout type="info">
3737
**ObjectOS** layers an in-product chat *runtime*
38-
on top of these same actions: it generates one `action_<name>` tool per action
38+
on top of these same actions: it generates one tool per exposed action
3939
and adds a server-side approval queue. Both the open MCP path and the ObjectOS
4040
runtime gate on the same `ai.exposed` opt-in. Those pieces are called out below.
4141
The open path — the same Action reachable as an MCP tool by your own AI — is the
4242
default.
43+
44+
An object-bound Action's tool is `action_<object>__<action>` (the object
45+
name, two underscores, the action name), and a top-level Action's, bound to no
46+
object, is `action_<action>`. A qualified name longer than 64 characters is
47+
shortened to its head plus a hash, so take the exact spelling from
48+
`actionToolName` in `@objectstack/spec/ai` rather than writing a long one by
49+
hand. The older `action_<action>` spelling of an object-bound Action still
50+
resolves, but to every exposed Action of that name, whatever its object.
51+
`action_*` keeps its meaning: every exposed Action.
4352
</Callout>
4453

4554
## The open path: Actions over MCP
@@ -247,7 +256,7 @@ with the app's own authority.
247256

248257
<Callout type="info">
249258
**ObjectOS** — the in-product chat runtime adds a *server-side*
250-
approval queue for its own `action_<name>` tools: a gated tool call is
259+
approval queue for its own action tools: a gated tool call is
251260
persisted as pending and returned to the model as
252261
`{ status: 'pending_approval', … }` instead of executing, and only the person
253262
the call ran as decides it in the **AI Pending Actions** inbox, on their own
@@ -303,7 +312,7 @@ resolves the authenticated principal from `req.user` — both cookie session
303312
`aiService.chatWithTools(...)` as
304313
`toolExecutionContext: { actor, conversationId, environmentId }`. That threads the
305314
same RLS context through the runtime's built-in data tools and its
306-
`action_<name>` tools. From a custom server route you pass the actor explicitly.
315+
action tools. From a custom server route you pass the actor explicitly.
307316
Omitting `toolExecutionContext` (or its `actor`) is **not** a system fallback:
308317
the contract fails closed and data tools run as an unauthenticated, RLS-on
309318
principal that sees nothing (#2991). Trusted internal callers (cron jobs,

‎content/docs/ai/agents.mdx‎

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ reaches an agent only when their surfaces match
198198

199199
Per [ADR-0109](https://github.com/objectstack-ai/objectstack/blob/main/docs/adr/0109-ai-tool-authoring-model.md)
200200
the default path declares **zero** `defineTool` records. The runtime already
201-
materialises one `action_<name>` tool per AI-exposed Action, so a skill names
202-
that tool directly. The Action is the same one your UI button runs, so
201+
materialises one tool per AI-exposed Action, so a skill names that tool
202+
directly. The Action is the same one your UI button runs, so
203203
permissions, validation and audit are identical whether a human clicks or the
204204
assistant calls:
205205

@@ -227,11 +227,20 @@ export const LeadQualificationSkill = defineSkill({
227227
surface: 'ask',
228228
instructions: `Score the lead with BANT from what you read, then convert it
229229
when the user agrees. Scoring is your judgement — there is no scoring tool.`,
230-
tools: ['get_record', 'query_records', 'action_convert_lead'],
230+
tools: ['get_record', 'query_records', 'action_crm_lead__convert_lead'],
231231
});
232232
```
233233

234-
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
235244
all three (`ai-skill-tool-unresolved`):
236245

237246
| Requirement | Why |
@@ -268,9 +277,10 @@ itself (a different LLM-facing description, fewer exposed parameters).
268277
when the server it is installed on lists every tool the skill binds, read from
269278
that server's own tool list when the prompt request is answered. A plain name is
270279
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
274284
HTTP endpoint and on any host that drives its own MCP server and calls
275285
`registerSkillPrompts`, stdio included; the plugin's own long-lived stdio
276286
server, which projects skills through `MCPServerRuntime.bridgePrompts` instead,
@@ -335,7 +345,7 @@ own `ask` / `build` records use exactly these fields):
335345
| `instructions` | System prompt / prime directives |
336346
| `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 |
337347
| `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) |
339349
| `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 |
340350

341351
There is no `type` field and no fixed agent "type" taxonomy — behaviour comes from
@@ -398,7 +408,7 @@ Always be professional and data-driven.`,
398408
},
399409

400410
// 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.
402412
// (There is no agent-level `knowledge` block — it was removed in protocol
403413
// 17 (#3896 close-out): declaring sources never scoped retrieval. Restrict
404414
// access at the knowledge-service/source level; describe intended
@@ -464,9 +474,9 @@ Use reputable data sources.`,
464474
maxTokens: 1000,
465475
},
466476

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.
470480
skills: ['contact_enrichment'],
471481
});
472482
```

‎content/docs/ai/connect-mcp.mdx‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ export const CaseTriageSkill = defineSkill({
637637
instructions: `Read the case, classify severity from the account tier and the
638638
symptom, then propose the next action. Never close a case the customer has not
639639
confirmed.`,
640-
tools: ['query_records', 'action_resolve_case'],
640+
tools: ['query_records', 'action_support_case__resolve_case'],
641641
});
642642
```
643643

@@ -657,15 +657,25 @@ empty list until then.
657657
the model to call the tools it binds, so `prompts/list` and `prompts/get` offer
658658
a skill only when the connection's own tool list carries every entry of its
659659
`tools`: a plain name by a tool of that name, a trailing wildcard (`describe_*`)
660-
by any listed tool it matches, and an `action_<name>` entry (or `action_*`) also
661-
by `run_action`. `case_triage` above is offered on a connection that lists
662-
`query_records` and `run_action`. A token without the `actions:execute` scope
660+
by any listed tool it matches, and any entry that starts with `action_`
661+
(`action_*` included) also by `run_action`. `case_triage` above is offered on a
662+
connection that lists `query_records` and `run_action`. A token without the `actions:execute` scope
663663
lists no `run_action`, so it is not offered `case_triage`, and `prompts/get`
664664
answers it as it answers an unknown prompt name. A skill that binds no tool is
665665
offered as before. When a prompt you expect is missing, connect with a grant
666666
that registers the skill's tools, or bind the skill only to tools its intended
667667
connections serve.
668668

669+
An action entry names the tool the in-product runtime materialises. An
670+
object-bound Action's tool is `action_<object>__<action>` (the object name, two
671+
underscores, the action name), and a top-level Action's, bound to no
672+
object, is `action_<action>`. A qualified name longer than 64 characters is
673+
shortened to its head plus a hash, so take the exact spelling from
674+
`actionToolName` in `@objectstack/spec/ai` rather than writing a long one by
675+
hand. The older `action_<action>` spelling of an object-bound Action still
676+
resolves, but to every exposed Action of that name, whatever its object.
677+
`action_*` keeps its meaning: every exposed Action.
678+
669679
**A skill written for the in-product agents opts out.** The binding answers
670680
whether a connection *can* run a playbook, not whether the playbook is written
671681
for MCP: a skill can bind tools MCP serves under the same names

‎content/docs/ai/tools.mdx‎

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ differs is where that name comes from:
3434
| What you want the agent to do | How you get there | Tool record? |
3535
|:---|:---|:---|
3636
| 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** |
3838
| Reach a system outside your app | Connect it over MCP — see [Connect an MCP Client](/docs/ai/connect-mcp) | **No** |
3939
| 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 |
4040

@@ -73,12 +73,21 @@ export const CaseTriageSkill = defineSkill({
7373
label: 'Case Triage',
7474
surface: 'ask',
7575
instructions: 'Read the case and its recent activity, then escalate when the customer is blocked.',
76-
tools: ['get_record', 'query_records', 'action_escalate_case'],
76+
tools: ['get_record', 'query_records', 'action_support_case__escalate_case'],
7777
});
7878
```
7979

80+
**The tool's name.** An object-bound Action's tool is
81+
`action_<object>__<action>` (the object name, two underscores, the action
82+
name), and a top-level Action's, bound to no object, is `action_<action>`. A qualified name longer than 64 characters is
83+
shortened to its head plus a hash, so take the exact spelling from
84+
`actionToolName` in `@objectstack/spec/ai` rather than writing a long one by
85+
hand. The older `action_<action>` spelling of an object-bound Action still
86+
resolves, but to every exposed Action of that name, whatever its object.
87+
`action_*` keeps its meaning: every exposed Action.
88+
8089
The full walkthrough — including the three conditions that decide whether
81-
`action_<name>` exists at all — is in
90+
an action's tool exists at all — is in
8291
[AI Agents](/docs/ai/agents#a-skill-needs-no-tool-records--name-the-action).
8392

8493
### Why that is the default
@@ -184,7 +193,7 @@ export const CaseHandoverSkill = defineSkill({
184193
label: 'Case Handover',
185194
surface: 'ask',
186195
instructions: 'Summarise before you escalate, and put the summary in the handover note.',
187-
tools: ['summarise_case', 'action_escalate_case', 'get_record'],
196+
tools: ['summarise_case', 'action_support_case__escalate_case', 'get_record'],
188197
});
189198
```
190199

@@ -196,8 +205,10 @@ tools (`MCP_FILE_TOOL_NAMES` in `@objectstack/spec/system`):
196205

197206
1. the stack's own `tools[]` names — the refinement records on this page;
198207
2. the curated registry of tools the platform runtime registers at boot;
199-
3. the materialised `action_<name>` family, one per AI-exposed Action declared
200-
on the stack or on any object.
208+
3. the materialised action family, one tool per AI-exposed Action declared
209+
on the stack or on any object: `action_<object>__<action>` when the Action
210+
is object-bound (its older `action_<action>` spelling resolves too), and
211+
`action_<action>` when it is top-level.
201212

202213
A trailing wildcard matches every member of that universe sharing the prefix, so
203214
`action_*` subscribes a skill to all of the app's exposed Actions at once.
@@ -212,7 +223,7 @@ it, never by listing it on the agent.
212223

213224
## See also
214225

215-
- [Actions as Tools](/docs/ai/actions-as-tools) — the default path: an Action materialised as an `action_<name>` tool
226+
- [Actions as Tools](/docs/ai/actions-as-tools) — the default path: an Action materialised as an `action_<object>__<action>` tool
216227
- [AI Agents](/docs/ai/agents) — the two platform agents, and skills as the extension primitive
217228
- [Connect an MCP Client](/docs/ai/connect-mcp) — reaching tools outside your app
218229
- [AI Skills System](/docs/ai/skills) — a different layer: the `SKILL.md` knowledge modules that teach a coding assistant to *write* your metadata

0 commit comments

Comments
 (0)