Skip to content

Conversation

@jussi-sa
Copy link
Contributor

@jussi-sa jussi-sa commented Jan 23, 2026

Description

The static_map_image_tool now returns a structured content array with both text and image content types, following the MCP specification for tool results with multiple content items.

Changes

  • StaticMapImageTool.ts: Add descriptive text content as first element in the response array, containing map metadata (center coordinates, zoom, size, style, overlay count)

  • StaticMapImageTool.test.ts: Update test expectations for new content array structure and add tests for text content format

  • docs/mcp-ui.md: Update documentation to reflect the new response format

    Response Format

Before:

content: [                                                                               
    { type: 'image', data: '...', mimeType: 'image/png' },                                 
    { type: 'resource', ... }  // optional                                                 
  ]                                                                                        

After:

content: [                                                                               
    { type: 'text', text: 'Static map image generated successfully.\nCenter: 40.7128, -74.006\nZoom: 12\n...' },                                                               
    { type: 'image', data: '...', mimeType: 'image/png' },                                 
    { type: 'resource', ... }  // optional
]

Testing

image

Checklist

  • Code has been tested locally
  • Unit tests have been added or updated
  • Documentation has been updated if needed

Additional Notes

@jussi-sa jussi-sa requested a review from a team as a code owner January 23, 2026 22:16
@jussi-sa jussi-sa changed the title Fix issue 103 - add text content to StaticMapImageTool response for better MCP client compatibility Fix issue 104 - add text content to StaticMapImageTool response for better MCP client compatibility Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue] Tool responses mix text and JSON instead of using structured content arrays per MCP specification

2 participants