A tiny TypeScript approval gate for AI tool calls, MCP tools, and human-in-the-loop workflows.
This is a library/framework for gating tool calls, not a traditional MCP server. Tool definitions are present but lack rigor. Naming is inconsistent (gateToolCall vs gateOpenAIToolCall vs createIntentGate, mixing verbs and domains). Descriptions are present but generic (e.g., 'Gate a generic tool call through the intent gate' repeats the tool name without explaining WHEN or WHY to use it). Input schemas exist but are sparse: many parameters lack type constraints, enums, or validation guidance. Output schemas are not documented. Error handling is minimal, no recovery guidance or categorization. The library is well-intentioned but does not meet production tool quality standards for LLM consumption.
Create an intent gate instance with agent context, policies, and optional fallback decision and event listener.
Create a policy object with a name, match function, and evaluate function.
Gate an Anthropic tool use (tool_use content block format) through the intent gate.
Gate an MCP tool call through the intent gate.
Gate an OpenAI tool call (function_call format) through the intent gate.
Gate a generic tool call through the intent gate, evaluating it against policies and returning a decision with optional executable command.
Descriptions are generic and repetitive. 'Gate a generic tool call through the intent gate' does not explain WHEN to use this tool, what problem it solves, or how it differs from the OpenAI/Anthropic variants. LLMs cannot infer intent from circular descriptions.
Input schemas lack type constraints and enums. The 'args' parameter in gateToolCall is typed as 'object' with no structure, validation rules, or examples. The 'requestedCapabilities' array has no item type or enum. Parameters like 'metadata' are vague, what fields does it accept?
Output schemas are not documented. What does gateToolCall return? The examples show 'decision', 'intent', and 'command' fields, but the tool definition does not declare the return type, field names, or structure. LLMs cannot plan downstream calls without knowing the response shape.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 34 | 2026-07-28+ | v2 |
Naming inconsistency and lack of verb clarity. Tools mix patterns: 'gateToolCall' (verb_noun), 'createIntentGate' (verb_noun), but 'createPolicy' (verb_noun), all use 'create' or 'gate' but do not clearly signal that these are factory/builder functions, not direct actions. An LLM might confuse 'createIntentGate' with a tool that creates a gate instance vs. one that evaluates a gate.
No error handling or recovery guidance. If a policy evaluation fails, or if 'requestedCapabilities' do not match agent capabilities, what happens? The tool definitions do not describe error cases, retryability, or what the LLM should do next.