Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .changeset/32885-skill-tools-binding-prose.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'@objectstack/spec': patch
'@objectstack/skills': patch
'@objectstack/mcp': patch
---

docs(spec,skills): `SkillSchema.tools` is described as what it now does on an MCP server, not as inert in the open framework

Clause-②: no
Metadata-protocol: none

Since 18.4.0 the prompt surface `registerSkillPrompts` (`@objectstack/mcp`) installs offers a skill on `prompts/list` and `prompts/get` only when the server it is installed on lists every tool the skill binds. The published texts still said the binding was authored for the cloud runtime and inert in the open framework, or that every skill with instructions is served to any connected client. They now state the rule; no schema, accept set or behaviour changes.

- **`@objectstack/spec`**: the `SkillSchema` class JSDoc, the `tools` JSDoc and its describe text (so the generated JSON Schema description and the skill reference page), plus one clause on the `instructions` JSDoc. `tools` is bound by the cloud agent runtime and read by MCP: a plain name is served by a tool of that name, a trailing wildcard by any listed tool it matches, and an `action_<name>` entry (or `action_*`) also by `run_action`. A skill that binds no tool is offered as before, and `prompts/get` answers a withheld skill as it answers a prompt name no skill derives. The rule reaches every server `registerSkillPrompts` is installed on, `MCPServerRuntime`'s HTTP door and a host's own `McpServer` alike, stdio included; `MCPServerRuntime.bridgePrompts`, which projects skills onto the long-lived server without it, applies no such filter. `surface` and `triggerConditions` stay cloud-runtime-only.
- **`@objectstack/skills`** (`objectstack-ai`): the built-in-skills note says the same, and the `instructions` row calls it the one field the open edition serves, since the open edition now reads `tools` as well.
- **`@objectstack/spec`**, liveness ledger (`liveness/skill.json`): the `tools` entry cites its in-repo reader, `skillBindingServed` in `packages/mcp/src/skill-prompts.ts`, beside the cloud readers, and its note no longer calls the key cloud-runtime-only.
- **`@objectstack/mcp`**: the README's Prompts section says which servers apply the rule. `bridgePrompts` lists every skill that carries instructions on the long-lived server; the HTTP door and any server a host installs `registerSkillPrompts` on offer a skill only when that server lists every tool it binds.
- The agents guide (`content/docs/ai/agents.mdx`) carries the rule under its two-halves table and advises binding a skill only to tools its intended connections serve. The MCP connection guide (`content/docs/ai/connect-mcp.mdx`) says a skill is offered only where its tools are: its example skill, bound to `query_records` and `action_resolve_case`, is not offered to a token without the `actions:execute` scope, which lists no `run_action`.
19 changes: 17 additions & 2 deletions content/docs/ai/agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,23 @@ itself (a different LLM-facing description, fewer exposed parameters).

| Half | Keys | Where it runs |
|---|---|---|
| **Judgment** | `instructions` | **Everywhere.** On the open framework `@objectstack/mcp` serves it as an MCP **prompt** — any connected client can `prompts/list` it by name and `prompts/get` the text ([Connect an MCP client](/docs/ai/connect-mcp#prompts-your-skills-served-to-the-client)). On **ObjectOS** it is injected into the active agent's system prompt. |
| **Wiring** | `tools`, `surface`, `triggerConditions` | **ObjectOS only.** Composing an agent's tool set and deciding when a skill activates are properties of an in-product agent loop. Over MCP the model lives in the client and drives one flat tool list, and your AI-exposed Actions already reach it as `action_<name>` via `list_actions` / `run_action`. |
| **Judgment** | `instructions` | **Both editions.** On the open framework `@objectstack/mcp` serves it as an MCP **prompt** — a connected client can `prompts/list` it by name and `prompts/get` the text ([Connect an MCP client](/docs/ai/connect-mcp#prompts-your-skills-served-to-the-client)), on a server that serves the tools the skill binds (below). On **ObjectOS** it is injected into the active agent's system prompt. |
| **Wiring** | `tools`, `surface`, `triggerConditions` | **Bound on ObjectOS only.** Composing an agent's tool set and deciding when a skill activates are properties of an in-product agent loop. Over MCP the model lives in the client and drives one flat tool list, and your AI-exposed Actions already reach it through `list_actions` / `run_action`. `surface` and `triggerConditions` are inert there; `tools` is read, and decides whether the skill is offered. |

**Over MCP, `tools` decides whether the skill is offered.** The prompt surface
`registerSkillPrompts` (`@objectstack/mcp`) installs lists and gets a skill only
when the server it is installed on lists every tool the skill binds, read from
that server's own tool list when the prompt request is answered. A plain name is
served by a tool of that name, a trailing wildcard (`describe_*`) by any listed
tool it matches, and an `action_<name>` entry (or `action_*`) also by
`run_action`. A skill that binds no tool is offered as before, and `prompts/get`
answers a withheld skill as it answers an unknown prompt name. This holds on the
HTTP endpoint and on any host that drives its own MCP server and calls
`registerSkillPrompts`, stdio included; the plugin's own long-lived stdio
server, which projects skills through `MCPServerRuntime.bridgePrompts` instead,
applies no such filter. So bind a skill only to tools its intended connections
serve: one that names a tool no MCP tool family serves is offered on no such
connection unless a host registers that tool.

Both halves are still **validated everywhere** — a skill naming a tool that
does not exist is an authoring error in either distribution. So a skill written
Expand Down
26 changes: 20 additions & 6 deletions content/docs/ai/connect-mcp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -448,10 +448,10 @@ to typed per-action tools) is the planned next step, consistent with ADR-0097's

## Prompts: your skills, served to the client

Tools are not the only primitive. Every **skill** you author (`*.skill.ts`,
Tools are not the only primitive. A **skill** you author (`*.skill.ts`,
`defineSkill`) that carries `instructions` is served as an MCP **prompt** — so
a connected client can list your app's playbooks by name and pull one into the
conversation:
conversation, on a connection that serves the tools the skill binds (below):

```typescript
export const CaseTriageSkill = defineSkill({
Expand All @@ -477,15 +477,29 @@ prompts in their own picker. Nothing to enable — the surface appears as soon a
the app has a skill with instructions, and `prompts/list` simply returns an
empty list until then.

**A skill is offered only where its tools are.** A skill's instructions teach
the model to call the tools it binds, so `prompts/list` and `prompts/get` offer
a skill only when the connection's own tool list carries every entry of its
`tools`: a plain name by a tool of that name, a trailing wildcard (`describe_*`)
by any listed tool it matches, and an `action_<name>` entry (or `action_*`) also
by `run_action`. `case_triage` above is offered on a connection that lists
`query_records` and `run_action`. A token without the `actions:execute` scope
lists no `run_action`, so it is not offered `case_triage`, and `prompts/get`
answers it as it answers an unknown prompt name. A skill that binds no tool is
offered as before. When a prompt you expect is missing, connect with a grant
that registers the skill's tools, or bind the skill only to tools its intended
connections serve.

**Only the instructions half projects.** A skill's `tools` / `surface` /
`triggerConditions` are read by the **in-product agent runtime** (the `ask` /
`triggerConditions` are bound by the **in-product agent runtime** (the `ask` /
`build` agents, cloud / Enterprise), which is the thing that composes a tool set
and decides when a skill activates. MCP has neither step: the model lives in
*your* client, driving one flat tool list, and your AI-exposed actions are
already reachable there as `list_actions` / `run_action`. So on the open
framework a skill contributes its judgment (as a prompt), not its wiring — and
the same skill file keeps its full meaning when the app runs on the cloud
runtime. See [AI Agents](/docs/ai/agents#you-extend-the-platform-with-skills-not-agents).
framework a skill contributes its judgment (as a prompt), not its wiring — its
`tools` are read only to decide the offer above — and the same skill file keeps
its full meaning when the app runs on the cloud runtime. See
[AI Agents](/docs/ai/agents#you-extend-the-platform-with-skills-not-agents).

<Callout type="warn">
**Two different "skills" again.** These are **agent skills** — `defineSkill`
Expand Down
2 changes: 1 addition & 1 deletion content/docs/references/ai/skill.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const result = SkillSchema.parse(data);
| **description** | `string` | optional | Skill description |
| **surface** | `Enum<'ask' \| 'build' \| 'both'>` | optional (default: `"ask"`) | Agent surface this skill binds to ('ask' \| 'build' \| 'both') — ADR-0063 §3; read by the cloud agent runtime only |
| **instructions** | `string` | optional | LLM instructions when skill is active — also served as an MCP prompt |
| **tools** | `string[]` | ✅ | Tool names belonging to this skill (supports trailing wildcard, e.g. `action_*`) — bound by the cloud agent runtime only |
| **tools** | `string[]` | ✅ | Tool names belonging to this skill (supports trailing wildcard, e.g. `action_*`) — bound by the cloud agent runtime; an MCP server whose prompts `registerSkillPrompts` installs offers the skill only when it serves every tool named here (an `action_` entry also through `run_action`) |
| **triggerConditions** | `{ field: string; operator: Enum<'eq' \| 'neq' \| 'in' \| 'not_in' \| 'contains'>; value: string \| string[] }[]` | optional | Programmatic activation conditions — evaluated by the cloud agent runtime only |
| **active** | `boolean` | optional (default: `true`) | Whether the skill is enabled |
| **protection** | `{ lock: Enum<'none' \| 'no-overlay' \| 'no-delete' \| 'full'>; reason: string; docsUrl?: string }` | optional | Package author protection block — lock policy for this skill. |
Expand Down
12 changes: 11 additions & 1 deletion packages/mcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,23 @@ Two prompt families are bridged — there is no per-item prompt registration cal
and its `agentName` argument names agents that boot holds; the open
framework registers none, so there it is not listed.
2. **One prompt per authored skill** that carries `instructions` (#3905). Write
a `*.skill.ts`, and its instructions become a prompt any connected MCP client
a `*.skill.ts`, and its instructions become a prompt a connected MCP client
can list and fetch.

The skill **list** is a snapshot taken when the bridge runs; each prompt's
**body** is re-read from metadata at `prompts/get` time, so an edited skill
serves fresh text without a restart.

`bridgePrompts` lists every such skill on the long-lived server. The HTTP door,
and any server a host installs `registerSkillPrompts` on, offers a skill on
`prompts/list` and `prompts/get` only when that server lists every tool the
skill binds (`SkillSchema.tools`), read from the server's own tool registry when
the prompt request is answered: a plain name by a tool of that name, a trailing
wildcard by any listed tool it matches, and an `action_<name>` entry (or
`action_*`) also by `run_action`. A skill that binds no tool is offered as
before, and `prompts/get` answers a withheld skill as it answers an unknown
prompt name.

## Extending the server from a host

⚠️ There is **no** imperative `registerTool()` / `registerResource()` /
Expand Down
4 changes: 3 additions & 1 deletion packages/runtime/src/domains/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,9 @@ export function buildMcpBridge(
// and the open distribution is MCP-only (BYO-AI): without this read the
// type is authorable, lint-validated and consumed by nothing here. The
// MCP runtime projects each skill's `instructions` onto the `prompts`
// primitive; the tool-binding half stays cloud-runtime-only.
// primitive. The tool-binding half binds nothing here, but it is read:
// `registerSkillPrompts` offers a skill only when this request's
// server lists every tool the skill binds.
//
// Resolved through THIS request's per-environment services — the same
// seam `listObjects` / `describeObject` use — so a multi-tenant host
Expand Down
Loading
Loading