Skip to content

docs: tool-writing tips and testing with Chrome's WebMCP extension - #75

Merged
kashishhora merged 1 commit into
mainfrom
kashish/webmcp-tool-guidance
Oct 19, 2026
Merged

kashishhora merged 1 commit into
mainfrom
kashish/webmcp-tool-guidance

Conversation

@kashishhora

Copy link
Copy Markdown
Member

Summary

Docs follow-up to Google's new WebMCP tooling (webmcp-extension and webmcp-skills).

  • README: a short "Testing in Chrome" note. Google's extension reads document.modelContext from an isolated-world content script, so it only sees native registrations and never the polyfill. With chrome://flags/#enable-webmcp-testing on, the provider uses the native API and everything shows up.
  • README / api.md: a handler that returns isError: true counts as a success in the hook (lastResult + onSuccess). Only a thrown error sets state.error and calls onError. This wasn't written down anywhere.
  • api.md: cross-origin iframes need allow="tools", because the spec gates WebMCP behind the tools Permissions Policy feature, which defaults to 'self'.
  • add-tool skill: tips adapted from Google's guidance. Covers keeping results small, waiting for UI updates before returning, throwing actionable errors, what + when descriptions, start_* vs act-now naming, and accepting natural input like "next Friday".

Docs only, no code changes. This doesn't touch the annotation lines that #74 edits.

Test Plan

  • pnpm lint
  • Checked the isError/onSuccess behavior against runHandler in useMcpTool.ts

@kashishhora
kashishhora merged commit f92f717 into main Oct 19, 2026
4 checks passed
@kashishhora
kashishhora deleted the kashish/webmcp-tool-guidance branch October 19, 2026 18:14
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.

2 participants