Skip to main content
Glama
conexaoarteiro

MindMeister MCP Server

mindmeister_get_map_image

Read-onlyIdempotent

Retrieve the image thumbnail of a MindMeister map using its ID, returning the image as base64-encoded data with content type and size metadata.

Instructions

Get the image/thumbnail for a MindMeister map.

Retrieves the map image via GET /map_images/{id}. Returns the image as base64-encoded data along with metadata.

Args: params: GetMapImageInput with map_id (str).

Returns: str: JSON with "map_id", "content_type", "content_base64", and "size_bytes".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler function for mindmeister_get_map_image tool. Fetches a map image/thumbnail from GET /map_images/{id}, returns base64-encoded PNG data (or JSON if API returns JSON).
    @mcp.tool(
        name="mindmeister_get_map_image",
        annotations={
            "title": "Get MindMeister Map Image",
            "readOnlyHint": True,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": True,
        },
    )
    async def mindmeister_get_map_image(params: GetMapImageInput) -> str:
        """Get the image/thumbnail for a MindMeister map.
    
        Retrieves the map image via GET /map_images/{id}. Returns the
        image as base64-encoded data along with metadata.
    
        Args:
            params: GetMapImageInput with map_id (str).
    
        Returns:
            str: JSON with "map_id", "content_type", "content_base64",
                 and "size_bytes".
        """
        try:
            resp = await api_request(
                _token(),
                "GET",
                f"/map_images/{params.map_id}",
                accept="image/png",
                timeout=60.0,
            )
            content_type = resp.headers.get("content-type", "image/png")
    
            # If the API returns JSON (e.g. a URL), return as-is
            if "json" in content_type:
                return _json_response(resp.json())
    
            encoded = base64.b64encode(resp.content).decode("ascii")
            result = {
                "map_id": params.map_id,
                "content_type": content_type,
                "content_base64": encoded,
                "size_bytes": len(resp.content),
            }
            return _json_response(result)
        except MindMeisterAPIError as exc:
            return f"Error: {exc}"
  • Registration of mindmeister_get_map_image as an MCP tool via the @mcp.tool decorator with annotations.
    @mcp.tool(
        name="mindmeister_get_map_image",
        annotations={
            "title": "Get MindMeister Map Image",
            "readOnlyHint": True,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": True,
        },
    )
  • Pydantic schema/input model for mindmeister_get_map_image. Defines a single required field: map_id (non-empty string).
    class GetMapImageInput(BaseModel):
        """Input for retrieving a map's image/thumbnail."""
    
        model_config = ConfigDict(str_strip_whitespace=True, extra="forbid")
    
        map_id: str = Field(
            ...,
            description="The MindMeister map ID",
            min_length=1,
        )
  • Helper functions used by the handler: _token() for auth, _json_response() for formatting output.
    def _token() -> str:
        """Return the current token (re-read env each call for flexibility)."""
        return os.environ.get("MINDMEISTER_API_TOKEN", "") or MINDMEISTER_API_TOKEN
    
    
    def _json_response(data: Any) -> str:
        """Serialize data to a pretty-printed JSON string."""
        return json.dumps(data, indent=2, ensure_ascii=False)
  • HTTP client helper that performs the actual API call to MindMeister API v2, with auth token, custom Accept header, and timeout support.
    async def api_request(
        token: str,
        method: str,
        path: str,
        *,
        params: Optional[Dict[str, Any]] = None,
        headers_extra: Optional[Dict[str, str]] = None,
        accept: str = "application/json",
        timeout: float = DEFAULT_TIMEOUT,
    ) -> httpx.Response:
        """Execute an authenticated request against MindMeister API v2.
    
        Returns the raw httpx.Response so callers can handle both JSON
        and binary (file export / image) responses.
    
        Raises:
            MindMeisterAPIError: on any HTTP or network error with an
                actionable message.
        """
        if not token:
            raise MindMeisterAPIError(
                "MINDMEISTER_API_TOKEN is not set. "
                "Export a personal access token from MindMeister "
                "(Account → API → Personal Access Tokens) and set it as an "
                "environment variable."
            )
    
        url = f"{BASE_URL}{path}"
        request_headers: Dict[str, str] = {
            "Authorization": f"Bearer {token}",
            "Accept": accept,
        }
        if headers_extra:
            request_headers.update(headers_extra)
    
        try:
            async with httpx.AsyncClient(timeout=timeout) as client:
                response = await client.request(
                    method,
                    url,
                    params=params,
                    headers=request_headers,
                )
                response.raise_for_status()
                return response
        except httpx.HTTPStatusError as exc:
            raise MindMeisterAPIError(
                _handle_http_error(exc), status_code=exc.response.status_code
            ) from exc
        except httpx.TimeoutException as exc:
            raise MindMeisterAPIError(
                "Request timed out. The MindMeister API may be slow — try again."
            ) from exc
        except httpx.RequestError as exc:
            raise MindMeisterAPIError(
                f"Network error: {type(exc).__name__}. Check your internet connection."
            ) from exc
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=true. The description adds value by specifying the HTTP method (GET) and the return format (base64-encoded data with metadata), which goes beyond the annotations without contradicting them.

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 concise and front-loaded: it opens with the core purpose, then provides implementation details and return format. Every sentence is meaningful, with no redundant or extraneous content.

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 tool's simplicity (one parameter, clear annotations, and an output schema), the description covers all necessary aspects: purpose, behavior, parameter, and return value. No critical information is missing for proper invocation.

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

Parameters3/5

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

The description restates the parameter 'params: GetMapImageInput with map_id (str)', but the input schema already documents 'map_id' with description 'The MindMeister map ID'. Thus, the description adds no new semantic meaning beyond the schema.

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: 'Get the image/thumbnail for a MindMeister map.' It provides a specific verb and resource, and the context with sibling tools (e.g., mindmeister_get_map) helps distinguish it as the image-specific retrieval tool.

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 explicit guidance on when to use this tool versus alternatives like mindmeister_get_map or mindmeister_export_map. The agent must infer based on the tool name and purpose, but no when-to-use or when-not-to-use instructions are provided.

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/conexaoarteiro/mindmeister-mcp'

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