Files
wehub-resource-sync f73e710e38
Build site and push to gh-pages / Build site (push) Waiting to run
Build / build (push) Waiting to run
Linter / lint (push) Waiting to run
Security / dependency-review (push) Waiting to run
Security / npm-audit (push) Waiting to run
Security / codeql (push) Waiting to run
Tests / test (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 12:42:51 +08:00
..

Structural tag MCP-style tool calls

Run npm install, then npm start to launch a minimal page that prints progress and logs to the browser console.

This example demonstrates how to:

  • Define a structural tag that forces an MCP-style <tool_call>...</tool_call> block with {"name": ..., "arguments": ...} payloads.
  • Ask WebLLM for a tool call with response_format.type = "structural_tag", parse the call, and dispatch to a stubbed tool implementation.
  • Send the tool result back via a tool message and request a final natural-language answer.

Open the console to see the enforced tool call, the stubbed tool response, and the final assistant reply.