Skip to main content
Glama

get_image_details

Extract detailed information for a specific image using its Openverse image ID. Provides insights for openly-licensed images, helping users identify and verify image attributes.

Instructions

Get detailed information about a specific image

Input Schema

NameRequiredDescriptionDefault
image_idYesOpenverse image ID (UUID format)

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "image_id": { "description": "Openverse image ID (UUID format)", "type": "string" } }, "required": [ "image_id" ], "type": "object" }

Implementation Reference

  • The execute handler function for the get_image_details tool. It fetches detailed information about a specific image from the Openverse API using the provided image_id, handles errors, and returns the JSON data.
    execute: async (args) => { try { const response = await fetch(`${OPENVERSE_API_BASE}/images/${args.image_id}/`, { headers: { 'User-Agent': 'MCP-Openverse/1.0' } }); if (!response.ok) { throw new Error(`Failed to fetch image details: ${response.status} ${response.statusText}`); } const data = await response.json(); return JSON.stringify(data, null, 2); } catch (error) { return JSON.stringify({ error: error instanceof Error ? error.message : 'Unknown error' }); } }
  • Zod schema for input validation of the get_image_details tool, requiring a single 'image_id' parameter.
    const imageDetailsSchema = z.object({ image_id: z.string().describe('Openverse image ID (UUID format)') });
  • src/index.ts:91-115 (registration)
    Registration of the 'get_image_details' tool with FastMCP server, including name, description, input schema, and handler function.
    server.addTool({ name: 'get_image_details', description: 'Get detailed information about a specific image', parameters: imageDetailsSchema, execute: async (args) => { try { const response = await fetch(`${OPENVERSE_API_BASE}/images/${args.image_id}/`, { headers: { 'User-Agent': 'MCP-Openverse/1.0' } }); if (!response.ok) { throw new Error(`Failed to fetch image details: ${response.status} ${response.statusText}`); } const data = await response.json(); return JSON.stringify(data, null, 2); } catch (error) { return JSON.stringify({ error: error instanceof Error ? error.message : 'Unknown error' }); } } });

Other Tools

Related 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/neno-is-ooo/mcp-openverse'

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