Skip to main content
Glama

search_images

Search the National Library's digital collection for images using keywords and optional year filters to find historical or cultural visual materials.

Instructions

Search for images in the National Library's digital collection.

Args: query: Search query string limit: Maximum number of results (default: 10) from_year: Start year (optional) to_year: End year (optional)

Returns: JSON string containing image search results with URLs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
limitNo
from_yearNo
to_yearNo

Implementation Reference

  • The main handler function for the 'search_images' tool. It is decorated with @mcp.tool() for registration and implements the logic to search images using dhlab.images.nbpictures.find_urls, returning JSON results or error messages.
    @mcp.tool() def search_images( query: str, limit: int = 10, from_year: int | None = None, to_year: int | None = None, ) -> str: """Search for images in the National Library's digital collection. Args: query: Search query string limit: Maximum number of results (default: 10) from_year: Start year (optional) to_year: End year (optional) Returns: JSON string containing image search results with URLs """ try: from dhlab.images.nbpictures import find_urls # find_urls returns a list of URLs results = find_urls(term=query, number=limit, mediatype="bilder") if results is not None and len(results) > 0: import json return json.dumps(results, ensure_ascii=False) return "No images found" except Exception as e: return f"Error searching images: {str(e)}"

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/marksverdhei/dhlab-mcp'

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