Skip to main content

Module tools

Module tools 

Source
Expand description

VAPP-161: a package’s TOOLS (docs/package-format.md “Tools”): the MCP servers and scripts its functions call (tools.<id>.<name> for an MCP tool, tools.<id> for a script), each behind the consent card the host MUST show before the first call. Mirrors packages/exponential-ui/src/host/tools.ts line by line; fixtures/host-router.json (validation) and fixtures/host-package.json consent + toolCalls replay it.

Structs§

ToolCall
The tool a host function name calls.
ToolConsentRow
One row of the consent card.

Constants§

TOOL_FUNCTION_PREFIX
The host function names a tool call starts with.
TOOL_ID_PATTERN
^[a-z][a-z0-9_-]{0,31}$: a tool’s id (package.tools.idPattern).
TOOL_KINDS
TOOL_TRANSPORTS

Functions§

is_tool_id
TOOL_ID_PATTERN.
tool_call
tools.<id> (a script) or tools.<id>.<name> (an MCP server’s tool); None = not a tool call (^tools\.([a-z][a-z0-9_-]{0,31})(?:\.(.+))?$, . matching no line terminator).
tool_consent
The consent card’s rows for a (valid) package’s tools, by id.
tool_consent_key
The key a remembered grant is stored under: ANY change to the tool’s definition is a new key (the card asks again).
validate_tools
Every problem with a package’s tools, ids in sorted order.