Skip to main content
Glama

set_message_handler

Create or replace a Perspective component message handler by specifying the view path, component, message type, and script.

Instructions

Create or replace a component message handler.

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": {
      "view_path": "<view_path>",
      "component": "<component>",
      "message_type": "<message_type>",
      "script": "<script>"
    },
    "name": "set_message_handler"
  }
}

Input Schema

NameRequiredDescriptionDefault
scriptYes
confirmNo
dry_runNo
projectNo
componentYes
view_pathYes
page_scopeNo
view_scopeNo
message_typeYes
session_scopeNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.7/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, and it discloses almost nothing. It doesn't say what 'replace' destroys (an existing handler's script and scope settings), what confirm/dry_run do, or what happens when the component or message_type doesn't exist.

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

Conciseness3/5

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

The sentence is front-loaded and free of redundancy, but the brevity reflects under-specification rather than economy. It is one clause where several would be warranted.

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?

The tool has an output schema, which reduces the need to describe return values, but the remaining gaps outweigh that convenience. With 10 parameters, 0% schema coverage, an upsert/mutation behavior, and no annotations, the description is far too thin for the complexity involved.

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

Parameters1/5

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

Schema description coverage is 0% across 10 parameters, and the description explains none of them. The four scope flags (page_scope, view_scope, session_scope, view_path), confirm, dry_run, and project all remain opaque, with no added meaning beyond bare titles.

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?

States a specific verb pair (create or replace) and a specific resource (component message handler), which is clear on its own. It does not distinguish the tool from siblings such as delete_message_handler or list_message_handlers, nor does it explain the upsert semantics implied by 'or replace'.

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?

No when-to-use guidance is given: nothing says when to use this versus related setters (set_event_script, set_binding, set_transform) or what prerequisites exist. The one sentence offers no context or exclusions.

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

Deploy Server

Other Tools