Skip to main content
Glama

lu_verify_message

Validate message sequences in AI agent sessions by checking protocol compliance and identifying expected next steps.

Instructions

Verify whether a message is valid in the context of an ongoing session.

Replays the existing message history against the protocol, then checks
whether next_message is the expected next step.

Args:
    protocol_text: Full .lu protocol definition text.
    messages: List of already-sent messages, each a dict with keys:
        sender (str), receiver (str), action (str).
        Actions are LU action names: "asks", "returns", "sends",
        "proposes", "tells". These match the verbs in .lu source files.
    next_message: The message to validate, same format as above.

Returns:
    JSON string:
      On success: {"valid": true, "step": N, "next_expected": "..."}
      On violation: {"valid": false, "violation": "...", "expected": "...", "got": "..."}
      On error: {"valid": false, "error": "..."}

Example:
    protocol_text = "protocol Ping:\n    roles: a, b\n    a asks b to ping\n    b returns pong to a\n    properties:\n        always terminates\n"
    messages = [{"sender": "a", "receiver": "b", "action": "ask"}]
    next_message = {"sender": "b", "receiver": "a", "action": "return"}
    # Returns: {"valid": true, ...}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
protocol_textYes
messagesYes
next_messageYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: it replays message history, checks against a protocol, and returns structured JSON outcomes (success, violation, error). It explains the return format in detail, which is crucial for understanding tool behavior beyond basic input-output.

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?

The description is appropriately sized and front-loaded with the core purpose. It includes necessary details like args, returns, and an example, all of which earn their place. However, the example is somewhat lengthy, slightly reducing conciseness, but overall it's well-structured and informative.

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

Completeness5/5

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

Given the complexity (3 parameters with nested objects, no annotations, and an output schema), the description is complete. It explains the tool's purpose, parameter semantics, and return values in detail. The output schema is present, so the description doesn't need to explain return values further, and it adequately covers all necessary context for effective use.

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

Parameters5/5

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

The schema description coverage is 0%, so the description must compensate. It adds significant meaning beyond the schema: it explains that 'protocol_text' is a full .lu protocol definition, 'messages' is a list of dicts with specific keys and action types, and 'next_message' follows the same format. This clarifies the semantics and structure of all parameters effectively.

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 clearly states the tool's purpose: 'Verify whether a message is valid in the context of an ongoing session.' It specifies the verb 'verify' and the resource 'message' in the context of a session and protocol. This distinguishes it from sibling tools like 'lu_check_properties' or 'lu_list_templates' which have different functions.

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?

The description implies usage by mentioning 'ongoing session' and 'protocol,' suggesting it's for validating message sequences in LU protocols. However, it does not explicitly state when to use this tool versus alternatives like 'lu_check_properties' or provide exclusions, leaving some ambiguity for the agent.

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/rafapra3008/cervellaswarm'

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