The runtime serves a tools verb per module with names, descriptions and schemas (design 34 §3), and refuses a module naming its own tool tools. Discovery asks catalog_modules then each module, naming what did not answer. One MCP handler over two transports: stdio (mesh mcp) and loopback HTTP (mesh serve, the mesh-console module, novox/hq ADR 0152); serve refuses any bind but loopback. tools/call may go through a running console with --console and no credential.
13 lines
482 B
JavaScript
13 lines
482 B
JavaScript
// A module's tool entrypoint, as the runtime imports one: registers and returns.
|
|
import { registerModuleTools } from "@novox/mesh-sdk/tools";
|
|
|
|
registerModuleTools("shop", () => [
|
|
{
|
|
name: "price",
|
|
description: "what something costs",
|
|
input: { of: { type: "string", description: "the thing" } },
|
|
run: async (args) => ({ of: args.of ?? "nothing", cost: 12 }),
|
|
},
|
|
{ name: "refund", description: "give it back", input: {}, run: async () => ({ done: true }) },
|
|
]);
|