Skip to main content
Glama
extentos

extentos

assertToolCalled

Verify that a specific assistant tool was called after a user utterance by waiting for the matching tool_called event, anchored before injection to avoid missing late calls.

Instructions

Phase 4 — wait for an assistant.tool_called event matching name (and optionally argsMatch partial-match). Re-scans the backend event log every ~200ms from a FIXED anchor until match or timeout, then returns the matched event payload directly (or errors with tool_not_called on timeout). Pass sinceCursor — the watchCursor from the injectAssistantUtterance that triggered the tool. That anchors the wait BEFORE the inject, so the triggered tool call (which the model fires 0.5-2s later) is always caught even if this call starts after the tool already fired. Without sinceCursor the call anchors at its own start ("now") and will MISS a tool that fired in the gap between your inject and this call — the dominant false-negative cause before the 2026-05-29 fix. The fixed-anchor re-scan (vs an advancing cursor) also means a late-committing event is never skipped, and the match is pure seq-comparison so it has zero clock-skew dependency. USE in the agent E2E loop right after injectAssistantUtterance. DON'T USE to inspect the full event trace (use getEventLog) or to check static tool registration (use inspectIntegration).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesExact tool name to wait for. Must match the `name` argument passed to `tool(name, description) { ... }` in the customer's glasses.assistant.start { } block.
argsMatchNoOptional top-level partial match against the tool's parsed args. All keys in argsMatch must be present in the call's args with equal scalar values; nested objects compared structurally. v1 ships top-level partial-match only — nested glob patterns deferred. Omit for any-args match.
sessionIdYes
timeoutMsNoMax time to wait, in ms. Default 5000. Clamped to [250, 60000]. The Mock provider dispatches in <50ms so 5000 is generous; OpenAi provider dispatches in 500-2000ms post-utterance (budget 10000+ for camera/vision tools).
sinceCursorNo**Strongly recommended.** The `watchCursor` value returned by the `injectAssistantUtterance` that should trigger this tool. Anchors the wait at the point BEFORE the inject, guaranteeing the triggered tool call is caught regardless of model latency or how quickly you call assertToolCalled. Omit only when watching for a tool with no preceding inject in this same agent turn (e.g. a tool fired by a real sim-browser voice turn) — then the call anchors at "now" and only catches tools that fire after this call starts.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It describes polling every 200ms from a fixed anchor, matching logic, timeout behavior, and the fixed-anchor re-scan guarantee. It does not explicitly state read-only nature but that is inferred.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is somewhat lengthy but every sentence is informative and earned. It is front-loaded with the core purpose and structured logically. Could be slightly more concise, but no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity and no output schema, the description fully covers return values (matched event payload or error), internal behavior (polling, fixed anchor), and rationale for design choices. No gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 80%, and description adds critical context for all parameters: name's matching semantics, argsMatch's partial top-level matching, timeoutMs defaults and provider-specific advice, and sinceCursor's role in preventing race conditions. This goes beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool waits for an 'assistant.tool_called' event matching a given name with optional argsMatch. It uses specific verbs and resources, and distinguishes itself from siblings like getEventLog and inspectIntegration.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use (right after injectAssistantUtterance in E2E loop) and when not to use (for full event trace or static registration). Also explains the critical sinceCursor parameter and provides guidance on timeoutMs based on providers.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/extentos/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server