Skip to main content
Glama

get_image_stats

Retrieve provider-specific statistics and image counts from Openverse to analyze and understand openly-licensed image resources effectively.

Instructions

Get statistics about image providers and counts

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": {}, "type": "object" }

Implementation Reference

  • The main handler function that executes the tool logic by fetching image statistics from the Openverse API endpoint and returning the JSON response.
    execute: async () => { try { const response = await fetch(`${OPENVERSE_API_BASE}/images/stats/`, { headers: { 'User-Agent': 'MCP-Openverse/1.0' } }); if (!response.ok) { throw new Error(`Failed to fetch stats: ${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 tool parameters, which is an empty object indicating no input parameters are required.
    parameters: z.object({}),
  • src/index.ts:153-177 (registration)
    Registration of the 'get_image_stats' tool with FastMCP server using server.addTool method.
    server.addTool({ name: 'get_image_stats', description: 'Get statistics about image providers and counts', parameters: z.object({}), execute: async () => { try { const response = await fetch(`${OPENVERSE_API_BASE}/images/stats/`, { headers: { 'User-Agent': 'MCP-Openverse/1.0' } }); if (!response.ok) { throw new Error(`Failed to fetch stats: ${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