Skip to main content
Glama

view

Retrieve email content from file paths using the mu mail indexer. Display message bodies, headers, and attachments by providing paths from mu search queries.

Instructions

View emails using mu, by providing their paths.

mu view $paths

Paths can be extracted using the following:

mu find --fields "l" SOME_QUERY

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'view' tool. Takes paths as input, runs 'mu view' subprocess command, and returns the email content or error message.
    def view(paths: str) -> str:
        """View emails using `mu`, by providing their paths.
    
        ```
        mu view $paths
        ```
    
        Paths can be extracted using the following:
        ```
        mu find --fields "l" SOME_QUERY
        ```
        """
        import subprocess
    
        try:
            result = subprocess.run(
                ["mu", "view"] + paths.split(), capture_output=True, text=True, check=True
            )
            return result.stdout.strip()
        except subprocess.CalledProcessError as e:
            return f"Error: {e.stderr.strip()}"
  • The function signature and docstring define the input schema (paths: str) and output schema (str). The docstring documents the tool's purpose, usage syntax, and how to obtain paths for the tool.
    @mcp.tool("view")
    def view(paths: str) -> str:
        """View emails using `mu`, by providing their paths.
    
        ```
        mu view $paths
        ```
    
        Paths can be extracted using the following:
        ```
        mu find --fields "l" SOME_QUERY
        ```
        """
  • mu_mcp/mu_mcp.py:47-47 (registration)
    The @mcp.tool("view") decorator registers the view function as an MCP tool named 'view' with the FastMCP server.
    @mcp.tool("view")
Behavior3/5

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

Discloses underlying CLI tool (mu) and command syntax, but without annotations, fails to indicate safety (read-only vs destructive), error conditions, or disposition despite having no annotations to rely on.

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?

Extremely efficient: front-loaded purpose statement followed by two precise code blocks demonstrating usage and data lineage, with zero redundant text.

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?

Adequate for a single-parameter tool; leverages the existence of an output schema to omit return value details, though safety annotations would have improved completeness.

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

Parameters4/5

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

Compensates effectively for 0% schema coverage by explaining 'paths' refers to email file paths obtainable via 'mu find --fields l', though it could clarify if the string accepts multiple paths.

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 specific action ('View emails') and resource (emails via mu), distinguishing it from the 'query' sibling by emphasizing path-based access rather than search.

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?

Provides implicit workflow guidance through code examples showing paths must be extracted via 'mu find' first, but lacks explicit 'when to use vs query' guidance or prerequisites.

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/danielfleischer/mu-mcp'

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