Skip to content

Describe open_app as acting in ICP apps so deferred-loading agents find it - #226

Merged
aterga merged 1 commit into
mainfrom
tool-discoverability
Nov 2, 2026
Merged

aterga merged 1 commit into
mainfrom
tool-discoverability

Conversation

@aterga

@aterga aterga commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Agents with deferred tool loading see each tool's name plus roughly the first line of its description, and the server instructions, before deciding whether to load anything. Today none of that says this server can act on the user's behalf in an Internet Computer app. In a recent session, an agent asked to "set up our cloud engine on opencloud.org" fell back to a web search instead of calling open_app, because open_app's first line only said "Open an app from its name or its URL: resolves the derivation origin…", which reads as a lookup rather than a way to do things in the app.

This PR changes model-readable text only. No behaviour, parameter or schema changes.

Related issues

None.

Changes

  • open_app description now opens with a self-contained first sentence saying what it is for: act as the user in any Internet Computer app (opencloud.org, OISY, NNS, Caffeine apps), by name or URL, then read or write through canister_query and canister_update_call. The existing details (derivation-origin resolution, canister discovery, the returned app_url) are kept after it.
  • Server instructions gain an opening paragraph: the server acts on the user's behalf in ICP apps signed in with their Internet Identity, open_app is the entry point, then getApiDoc or Candid, then the call, and this is preferred over searching for the app or sending the user to the site.
  • canister_query and canister_update_call descriptions end with "Usually called after open_app, which supplies app_url and derivation_origin."
  • The SERVER_INSTRUCTIONS doc comment is adjusted to describe the one entry-point paragraph it now carries, so it stays accurate.

The wording was adjusted to pass the existing marketplace policy gate (model_readable_metadata_respects_marketplace_policy): the initial draft used "whenever the user" and "web search", both on the banned-phrase list, and those were replaced with "Enables doing what the user asks…" and "searching for the app". The gate itself is unchanged.

Testing

  • cargo build --locked --all-targets
  • cargo test --locked --all-targets (all suites green, 206 core unit tests included)
  • cargo fmt --all / cargo clippy --all-targets (the five map_or clippy warnings are pre-existing on main and untouched here)
  • npm test --prefix monitoring/mcp-status (dashboard not changed)

Checklist

  • I have read the Contributing guidelines.
  • Docs (README / comments) updated for any user-visible change.
  • No secrets, credentials, or internal-only information are included.

Generated by Claude Code

…nd it

Agents that defer tool loading see each tool's name plus roughly the
first line of its description, so nothing told them this server can act
on the user's behalf in an Internet Computer app: an agent asked to set
up a cloud engine on opencloud.org fell back to a web search instead of
open_app.

Text only; no behaviour, parameter or schema changes:

- open_app's description now opens with what it is for (act as the user
  in any ICP app, by name or URL) and names example apps, then keeps the
  resolution and discovery details.
- The server instructions open with a paragraph saying the server acts
  in ICP apps on the user's behalf and that open_app is the entry point.
- canister_query and canister_update_call say they are usually called
  after open_app, which supplies app_url and derivation_origin.

Worded to pass the marketplace policy gate (no "whenever the user", no
mention of web search), and the SERVER_INSTRUCTIONS doc comment is
adjusted to describe the one entry-point paragraph it now carries.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VP2vTEQ56tUkggbuvCwiRD

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new tool description conflicts with the metadata policy against preferring one tool over others, so the comparative routing directive needs to be removed.

1 open issue
What changed in this PR

Updates model-readable metadata so agents using deferred tool loading can recognize open_app as the entry point for acting in Internet Computer apps. Runtime logic, parameters, and schemas remain unchanged.

Changes:

  • Leads the open_app description with its user-facing capabilities and example apps.
  • Adds server-level entry-point guidance and cross-references from query and update tool descriptions.
  • Adjusts the SERVER_INSTRUCTIONS doc comment to reflect the added guidance.
File Description
crates/​imcp2-core/​src/​tools.rs Revises tool descriptions, server instructions, and the accompanying doc comment to improve discoverability.

Review effort: Balanced

Comment thread crates/imcp2-core/src/tools.rs Resolved
@aterga
aterga marked this pull request as ready for review November 2, 2026 15:51
@aterga
aterga requested a review from a team November 2, 2026 15:51
@aterga
aterga merged commit 3481f2b into main Nov 2, 2026
17 checks passed
aterga pushed a commit that referenced this pull request Nov 3, 2026
main rewrote the served instructions string (#226 added the opening
paragraph on acting in ICP apps) while this branch changed its last
sentence. Resolved by taking main's string and re-applying the one
sentence: deploying happens outside this server, with the icp CLI or
through a proxy deployment service.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VP2vTJFX1J2wcdJqM9kk1B
aterga pushed a commit that referenced this pull request Nov 3, 2026
One conflict, in SERVER_INSTRUCTIONS: main's rewording (#223, #226) is kept
and this branch's CANISTERS clause about `view: "summary"` and `methods` is
re-applied to it.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VP2vTFU9SfBJ9yharm2fuJ
aterga added a commit that referenced this pull request Nov 3, 2026
All three crates share one version. A patch bump: nothing since 0.6.0
changes the crates' public API or refuses anything 0.6.0 allowed. It
carries the mcp_get_delegation retry on a lagging replica (#220), the
bound on what one /oauth/authorize request stores (#221), the reworded
open_app and call tool descriptions and server instructions (#226), and
clippy fixes (#224).

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants