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
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | The message object to send (must be JSON-serializable) | |
| timeout_ms | No | Milliseconds to wait for a response before timing out (default: 5000) |