hou_tea_discover_extended
Unlock additional tea tools for comparison, health filtering, and agent cards when core tools are not enough.
Instructions
[meta] Reveal extended tools (compare / health-filter / agent-card) by adding them to tools/list. Optionally filter by groups or specific tools. Call this when the core 6 tools aren't enough for the user's intent. Idempotent.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groups | No | Reveal all tools in these groups. Default: ['extended']. | |
| tools | No | Reveal a specific subset of extended tools by name. |
Implementation Reference
- src/index.ts:68-89 (schema)The tool `hou_tea_discover_extended` is defined as a meta-tool (not in the registry). It is defined inline with name, description, and inputSchema (accepting optional `groups` and `tools` arrays).
const DISCOVERY_TOOL_NAME = "hou_tea_discover_extended"; const DISCOVERY_TOOL = { name: DISCOVERY_TOOL_NAME, description: "[meta] Reveal extended tools (compare / health-filter / agent-card) by adding them to tools/list. Optionally filter by `groups` or specific `tools`. Call this when the core 6 tools aren't enough for the user's intent. Idempotent.", inputSchema: { type: "object" as const, properties: { groups: { type: "array", items: { type: "string", enum: ["extended"] }, description: "Reveal all tools in these groups. Default: ['extended'].", }, tools: { type: "array", items: { type: "string" }, description: "Reveal a specific subset of extended tools by name.", }, }, additionalProperties: false, }, }; - src/index.ts:133-177 (handler)The `handleDiscover` function is the actual handler/executor for `hou_tea_discover_extended`. It reveals extended tools by adding them to the `revealedExtended` Set, sends a tool list changed notification, and returns the list of revealed/available extended tools.
async function handleDiscover(args: Record<string, unknown>) { const ctx = startCall(DISCOVERY_TOOL_NAME); const groups = Array.isArray(args.groups) ? (args.groups as string[]) : ["extended"]; const explicit = Array.isArray(args.tools) ? (args.tools as string[]) : undefined; const before = new Set(revealedExtended); if (groups.includes("extended")) { if (explicit && explicit.length > 0) { for (const n of explicit) { if (EXTENDED_TOOL_NAMES.has(n)) revealedExtended.add(n); } } else { for (const n of EXTENDED_TOOL_NAMES) revealedExtended.add(n); } } const newlyRevealed = [...revealedExtended].filter((n) => !before.has(n)); // Notify any listening MCP clients that the tool list changed. if (newlyRevealed.length > 0) { try { await server.sendToolListChanged(); } catch { // notification is best-effort; older clients may not subscribe. } } return jsonResult( wrapOk( ctx, { revealed: [...revealedExtended], newly_revealed: newlyRevealed, available_extended: extendedSummary(), }, newlyRevealed.length > 0 ? [ { tool: "tools/list", reason: "Re-list tools to see the newly revealed extended tools.", }, ] : undefined ) ); } - src/index.ts:91-93 (registration)The `listTools` function includes `DISCOVERY_TOOL` alongside core + revealed extended tools, registering the discovery tool in the MCP tools/list response.
function listTools() { return [...listForMcp(revealedExtended), DISCOVERY_TOOL]; } - src/index.ts:183-185 (registration)The CallToolRequestSchema handler routes calls with name === DISCOVERY_TOOL_NAME to `handleDiscover`, effectively registering the tool for invocation.
if (name === DISCOVERY_TOOL_NAME) { return handleDiscover(args); } - src/tools/registry.ts:285-338 (helper)The `EXTENDED_TOOLS` array (and `EXTENDED_TOOL_NAMES` set) defines the extended tools that `hou_tea_discover_extended` can reveal (compare, filter_by_health, agent_card).
const EXTENDED_TOOLS: ToolDef[] = [ { name: "hou_tea_compare", group: "extended", summary: "Side-by-side compare 2–4 products.", description: "Compare 2–4 products across sensory profile, price, brewing difficulty, season, and use-case. Use when the user is choosing between specific candidates.", inputSchema: obj( { skill_ids: { type: "array", items: { type: "string" }, minItems: 2, maxItems: 4, uniqueItems: true, }, }, ["skill_ids"] ), execute: (args) => houTea.compare(args as unknown as Parameters<typeof houTea.compare>[0]), }, { name: "hou_tea_filter_by_health", group: "extended", summary: "Filter teas by health constraints (pregnancy, insomnia, etc.).", description: "Filter products by health constraints. Returns only teas safe under the given conditions (e.g. avoid caffeine for insomnia or pregnancy, avoid strong tannins for sensitive stomachs).", inputSchema: obj( { conditions: { type: "array", items: { type: "string" }, minItems: 1, }, limit: { type: "integer", minimum: 1, maximum: 50, default: 10 }, }, ["conditions"] ), execute: (args) => houTea.constraints( args as unknown as Parameters<typeof houTea.constraints>[0] ), }, { name: "hou_tea_agent_card", group: "extended", summary: "Capability descriptor (/.well-known/agent) — diagnostics.", description: "Fetch the full hou-tea agent capability descriptor (/.well-known/agent). Useful for discovering the latest API surface, payment recipient address, and supported networks. Call this if other tools behave unexpectedly.", inputSchema: obj({}), execute: () => houTea.agentCard(), }, ];