Skip to main content
Glama
r-huijts

OpenTK Model Context Protocol Server

by r-huijts

get_photo

Retrieve official portrait photographs of Dutch Members of Parliament for use in reports, presentations, or profiles. Input the MP's unique ID to receive the image as a binary resource.

Instructions

Retrieves the official portrait photograph of a Member of Parliament. Returns the image as a binary resource that can be displayed or saved. Use this when you need to include a visual representation of an MP in reports, presentations, or profiles.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
personIdYesMP's numeric ID - the unique identifier for the Member of Parliament whose photo you want to retrieve

Implementation Reference

  • The complete handler and registration for the 'get_photo' MCP tool. Fetches the MP's portrait image as binary data from the API endpoint `/personphoto/{personId}`, encodes it to base64, and returns it as an image/jpeg resource. Includes input schema validation with Zod and error handling.
    mcp.tool(
      "get_photo",
      "Retrieves the official portrait photograph of a Member of Parliament. Returns the image as a binary resource that can be displayed or saved. Use this when you need to include a visual representation of an MP in reports, presentations, or profiles.",
      { personId: z.string().describe("MP's numeric ID - the unique identifier for the Member of Parliament whose photo you want to retrieve") },
      async ({ personId }) => {
        try {
          const { data } = await apiService.fetchBinary(`/personphoto/${encodeURIComponent(personId)}`);
          const base64 = Buffer.from(data).toString("base64");
          return {
            content: [
              {
                type: "resource",
                resource: {
                  uri: `photo://${personId}`,
                  blob: base64,
                  mimeType: "image/jpeg"
                }
              }
            ]
          };
        } catch (error: any) {
          return {
            content: [{
              type: "text",
              text: `Error fetching MP photo: ${error.message || 'Unknown error'}`
            }]
          };
        }
      }
    );

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/r-huijts/opentk-mcp'

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