view
Retrieve and display the full content of an email using its file path from the mu mail indexer.
Instructions
View emails using mu, by providing their paths.
mu view $pathsPaths can be extracted using the following:
mu find --fields "l" SOME_QUERYInput Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- mu_mcp/mu_mcp.py:47-68 (handler)The view tool handler function. Executes `mu view` via subprocess with the provided paths argument.
@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 ``` """ 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()}" - mu_mcp/mu_mcp.py:47-47 (registration)The view tool is registered with the name "view" via the @mcp.tool("view") decorator on line 47.
@mcp.tool("view") - mu_mcp/mu_mcp.py:48-48 (schema)The schema for the view tool is defined by the function signature `def view(paths: str) -> str`, accepting a single string parameter and returning a string.
def view(paths: str) -> str: