Skip to main content
Glama

Rijksmuseum MCP Server

by r-huijts
MIT License
22
57
  • Apple
  • Linux
PromptHandler.js3.67 kB
import { McpError, ErrorCode } from "@modelcontextprotocol/sdk/types.js"; export class PromptHandler { constructor() { this.PROMPTS = { "analyze-artwork": { name: "analyze-artwork", description: "Analyze an artwork's composition, style, and historical context", arguments: [{ name: "artworkId", description: "ID of the artwork to analyze", required: true }] }, "generate-artist-timeline": { name: "generate-artist-timeline", description: "Generate a chronological timeline of an artist's most notable works", arguments: [{ name: "artist", description: "Name of the artist", required: true }, { name: "maxWorks", description: "Maximum number of works to include (default: 10)", required: false }] } }; } listPrompts() { return { prompts: Object.values(this.PROMPTS) }; } getPrompt(name, arguments_) { const prompt = this.PROMPTS[name]; if (!prompt) { throw new McpError(ErrorCode.InvalidRequest, `Prompt not found: ${name}`); } if (name === "generate-artist-timeline") { const { artist, maxWorks } = arguments_ || {}; if (!artist) { throw new McpError(ErrorCode.InvalidRequest, "Artist name is required"); } return { messages: [ { role: "user", content: { type: "text", text: `Create a visual timeline artifact showing the chronological progression of ${artist}'s most notable works${maxWorks ? ` (limited to ${maxWorks} works)` : ''}. For each work, include: - Year of creation - Title of the work - A brief description - The artist's age at the time of creation Format the timeline as a visually appealing chronological progression, with clear spacing between different time periods. Use markdown formatting to enhance readability. The data for this timeline will be provided by the get_artist_timeline tool. Please call this tool with the artist name "${artist}"${maxWorks ? ` and maxWorks=${maxWorks}` : ''} to get the artwork data, then create a beautiful visualization of the timeline.` } } ] }; } if (name === "analyze-artwork") { const { artworkId } = arguments_ || {}; if (!artworkId) { throw new McpError(ErrorCode.InvalidRequest, "Artwork ID is required"); } return { messages: [ { role: "user", content: { type: "text", text: `Analyze the composition, style, and historical context of artwork ${artworkId} and provide a detailed analysis of the artwork's meaning and significance in the context of the artist's oeuvre and the broader art world, then create a beautiful artifact that captures the essence of the artwork and its context.` } } ] }; } throw new McpError(ErrorCode.InvalidRequest, `Prompt implementation not found: ${name}`); } }

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/rijksmuseum-mcp'

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