Skip to main content
Glama

send_message_to_background

Sends a JSON message from an extension popup to its background service worker and returns the response, so you can test runtime messaging.

Instructions

Send a chrome.runtime.sendMessage to the extension's background service worker and return the response. Runs from within the extension's popup context.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "message": "<message>"
    },
    "name": "send_message_to_background"
  }
}

Input Schema

NameRequiredDescriptionDefault
messageYesThe message object to send (must be JSON-serializable)
timeout_msNoMilliseconds to wait for a response before timing out (default: 5000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.4.0

TDQS

C2.9/5.0
Behavior2/5

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

There are no annotations, so the description carries the full behavioral burden. It discloses the chrome.runtime.sendMessage mechanism and that a response is returned, but it omits side effects, permission requirements, error behavior, and what happens on timeout beyond the schema's timeout_ms field.

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 concise sentences with the core operation front-loaded and no redundant wording. The popup-context note is brief and does not distract from the main action.

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

Completeness2/5

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

The tool has no annotations, no output schema, and a nested message object, yet the description is very thin. It does not explain response shape, error/timeout semantics, side effects, or when to use this over related tools, leaving important context missing for correct invocation.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents the message object and timeout_ms. The description adds no additional meaning about parameter format, required message shape, or timeout behavior beyond what the schema provides.

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

Purpose4/5

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

The description states a specific verb and resource: sending chrome.runtime.sendMessage to the extension's background service worker and returning the response. It is clear what the tool does, though it does not explicitly contrast itself with sibling tools such as get_service_worker_logs or interact_with_popup.

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

Usage Guidelines2/5

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

The description only notes that it runs from the popup context; it gives no explicit when-to-use guidance, when-not-to-use conditions, or alternatives among the sibling tools. An agent must infer when messaging the background service worker is appropriate.

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