Skip to main content
Glama

analyze_message_content

Examine and decode the content types and structure of ACP messages to streamline integration and communication between ACP-based AI agents and MCP-compatible tools.

Instructions

Analyze the content types and structure of an ACP message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
acp_message_jsonYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The @mcp.tool()-decorated async handler function that implements the core logic of the 'analyze_message_content' tool. It parses the input acp_message_json into an ACPMessage, analyzes the parts (total count, content types, presence of URLs, encodings, total content size), and returns a structured JSON analysis.
    @mcp.tool()
    async def analyze_message_content(acp_message_json: str) -> str:
        """Analyze the content types and structure of an ACP message"""
        try:
            import json
            message_data = json.loads(acp_message_json)
            acp_message = ACPMessage(**message_data)
            
            analysis = {
                "total_parts": len(acp_message.parts),
                "content_types": {},
                "has_urls": False,
                "encodings": set(),
                "total_size": 0
            }
            
            for part in acp_message.parts:
                content_type = part.content_type
                analysis["content_types"][content_type] = analysis["content_types"].get(content_type, 0) + 1
                analysis["encodings"].add(part.content_encoding)
                
                if part.content_url:
                    analysis["has_urls"] = True
                
                if part.content:
                    analysis["total_size"] += len(part.content)
            
            analysis["encodings"] = list(analysis["encodings"])
            
            return json.dumps(analysis, indent=2)
            
        except Exception as e:
            return f"Error: {e}"
  • Pydantic BaseModel definitions for ACPMessagePart (lines 8-14) and ACPMessage (lines 15-17), which provide input validation and type parsing for the ACP message structure used in the analyze_message_content handler.
    class ACPMessagePart(BaseModel):
        name: Optional[str] = None
        content_type: str
        content: Optional[str] = None
        content_encoding: Optional[str] = "plain"
        content_url: Optional[str] = None
    
    class ACPMessage(BaseModel):
        parts: List[ACPMessagePart]
  • Invocation of register_bridge_tools(self.mcp, self.message_bridge) during server initialization, which executes the tool registrations including the @mcp.tool() decorator for analyze_message_content.
    register_bridge_tools(self.mcp, self.message_bridge)
  • The register_bridge_tools function definition that contains the @mcp.tool() registrations for bridge tools, including analyze_message_content and convert_acp_message.
    def register_bridge_tools(mcp: FastMCP, bridge: MessageBridge):
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 of behavioral disclosure. It states the tool 'analyzes' content types and structure, implying a read-only operation, but doesn't specify behavioral traits such as whether it's idempotent, has side effects, requires specific permissions, or handles errors. For a tool with no annotation coverage, this leaves significant gaps in understanding how it behaves beyond its basic function.

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?

The description is a single, clear sentence that directly states the tool's function without unnecessary words. It's front-loaded with the core action ('Analyze') and resource ('ACP message'), making it efficient and easy to parse. Every part of the sentence contributes to understanding the purpose, earning its place.

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 the tool has an output schema (which should detail return values), the description doesn't need to explain outputs. However, with no annotations, 1 parameter at 0% coverage, and moderate complexity (analyzing message structure), the description is incomplete—it lacks details on usage, parameters, and behavioral context. It's minimally viable but has clear gaps that could hinder effective tool selection and invocation.

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

Parameters2/5

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

The input schema has 1 parameter with 0% description coverage, and the tool description doesn't add any semantic details about the parameter. It doesn't explain what 'acp_message_json' should contain (e.g., JSON format, required fields, examples) or how it's used in the analysis. With low schema coverage, the description fails to compensate, leaving the parameter's meaning unclear beyond its name.

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

Purpose3/5

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

The description states the tool analyzes 'content types and structure of an ACP message', which provides a general purpose (analyze message content). However, it lacks specificity about what 'analyze' entails (e.g., extracting metadata, identifying patterns, validating structure) and doesn't distinguish it from sibling tools like 'convert_acp_message' or 'smart_route_request', which might also involve message processing. It's not tautological but remains somewhat vague.

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 offers no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an ACP message), exclusions (e.g., not for routing or conversion), or compare to siblings like 'convert_acp_message' (which transforms messages) or 'smart_route_request' (which might analyze for routing). Without such context, users must infer usage from the name alone.

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

Related 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/GongRzhe/ACP-MCP-Server'

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