Skip to main content
Glama

test_context_menu

Verifies extension context menus by checking the contextMenus API, simulating right-clicks on page elements, and triggering menu item handlers to validate behavior.

Instructions

Test context menus registered by the extension. Can verify the contextMenus API is available and simulate right-click events on page elements.

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": {
      "action": "<action>"
    },
    "name": "test_context_menu"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoURL to navigate to before right-clicking (optional)
actionYescheck_api: verify contextMenus API is available in service worker; right_click: simulate right-click on a selector (triggers contextmenu DOM event); trigger_item: invoke a context menu item handler by id via service worker
page_urlNoThe pageUrl to pass to the onClicked handler (for 'trigger_item' action)
selectorNoCSS selector of the element to right-click (for 'right_click' action)
menu_item_idNoThe context menu item ID to trigger (for 'trigger_item' action — matches the id passed to chrome.contextMenus.create)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.4.0

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It does mention that right_click simulates a DOM contextmenu event and that check_api verifies the API in the service worker, but it omits important behavior: whether trigger_item causes real side effects in the extension, whether navigation occurs if url is supplied, and what happens on failure. For a tool with a mutating action and no annotation coverage, this is a substantial gap.

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?

Two sentences with no filler, and the description leads with the core purpose before naming the specific capabilities. It earns its place and avoids repetition. The description of the behavior could be fuller, but it is not padded.

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

Completeness3/5

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

Given five parameters, one enum with three distinct actions, no output schema, and no annotations, the description should explain the difference in side effects among the three actions and what a caller gets back. It sketches the actions but leaves the caller to infer side effects and results from the schema alone.

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 each of the five parameters is already documented in the schema, including the action enum and the per-action field rationale. Consequently, the description adds little beyond what the schema provides. The baseline score of 3 applies because the schema does all the work.

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: test context menus registered by an extension, verify the contextMenus API, and simulate right-click events on page elements. This distinguishes it from generic DOM interaction siblings like inspect_dom or simulate_tab_events. It doesn't name a specific alternative, but the purpose itself is precise and unambiguous.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: the tool is for extension development or testing scenarios involving context menus. There is no explicit when-to-use versus when-not-to-use guidance, and no alternates (e.g., use inspect_dom for general element inspection) are mentioned. An agent can infer the context but must do the work itself.

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