Skip to main content
Glama

inject_context

Update AI agents with real-time context during active phone calls. Send mid-call information such as order updates or customer details to improve conversation accuracy.

Instructions

Send a message or context into an active streaming call's AI agent. Use this to give the AI agent new information mid-call (e.g. 'The customer's order #1234 has shipped').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
call_idYesThe call ID (must be an active streaming call)
messageYesThe context message to inject (max 2000 chars)

Implementation Reference

  • The handler function that executes the inject_context tool logic. It receives params (call_id and message) and makes a POST request to /calls/{call_id}/context endpoint using the client.
      async (params) => callTool(() => client.post(`/calls/${params.call_id}/context`, { message: params.message }))
    );
  • Input schema definition for inject_context tool using Zod validation. Defines call_id (string) and message (string, max 2000 chars) parameters with descriptions, plus tool annotations indicating it's not read-only, not destructive, not idempotent, and has open-world behavior.
    {
      description:
        "Send a message or context into an active streaming call's AI agent. " +
        "Use this to give the AI agent new information mid-call (e.g. 'The customer's order #1234 has shipped').",
      inputSchema: {
        call_id: z.string().describe("The call ID (must be an active streaming call)"),
        message: z.string().describe("The context message to inject (max 2000 chars)"),
      },
      annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
    },
  • Complete registration of the inject_context tool with the MCP server. Registers the tool name 'inject_context' along with its schema and handler function.
    server.registerTool(
      "inject_context",
      {
        description:
          "Send a message or context into an active streaming call's AI agent. " +
          "Use this to give the AI agent new information mid-call (e.g. 'The customer's order #1234 has shipped').",
        inputSchema: {
          call_id: z.string().describe("The call ID (must be an active streaming call)"),
          message: z.string().describe("The context message to inject (max 2000 chars)"),
        },
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
      },
      async (params) => callTool(() => client.post(`/calls/${params.call_id}/context`, { message: params.message }))
    );
Behavior3/5

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

Annotations cover readOnly/destructive/idempotent hints, so the bar is lower. The description adds valuable domain context ('active streaming call', 'AI agent', 'mid-call') that clarifies scope. However, it omits behavioral details like whether the AI immediately processes the message or if injection triggers an immediate response.

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

Conciseness5/5

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

Two sentences with zero waste: first defines the action, second provides usage context and example. Information is front-loaded and every clause earns its place.

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

Completeness4/5

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

For a 2-parameter tool with complete schema coverage and present annotations, the description is nearly complete. Minor gap: it doesn't describe the return value or immediate effect on the call (e.g., whether the AI verbally acknowledges the injection).

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

Parameters4/5

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

Despite 100% schema coverage (baseline 3), the description adds semantic value through the example message ('The customer's order #1234 has shipped'), which clarifies that the 'message' parameter is intended for business context/updates rather than arbitrary text.

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 provides a specific verb ('Send') and resource ('message or context into an active streaming call's AI agent') that clearly distinguishes it from siblings like hangup_call, transfer_call, or get_call. It precisely identifies the target domain (AI agent within active calls).

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

Usage Guidelines4/5

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

Explicitly states when to use ('give the AI agent new information mid-call') and provides a concrete example ('The customer's order #1234 has shipped'). However, it lacks explicit 'when not to use' guidance or mention of alternatives for non-streaming calls.

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/JobXDubai/mcp-server'

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