Skip to main content
Glama

get_corpus_statistics

Analyze statistical information from a corpus of documents by providing URN identifiers. Returns JSON with corpus statistics for Norwegian digital collections.

Instructions

Get statistical information about a corpus of documents.

Args: urns: List of URN identifiers for documents

Returns: JSON string containing corpus statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urnsYes

Implementation Reference

  • The main handler function decorated with @mcp.tool(), which both implements the tool logic and registers it. Fetches document metadata for given URNs and returns JSON statistics.
    @mcp.tool() def get_corpus_statistics(urns: list[str]) -> str: """Get statistical information about a corpus of documents. Args: urns: List of URN identifiers for documents Returns: JSON string containing corpus statistics """ try: from dhlab.api.dhlab_api import get_metadata metadata = get_metadata(urns=urns) if metadata is not None and len(metadata) > 0: return metadata.to_json(orient='records', force_ascii=False) return "No metadata available" except Exception as e: return f"Error getting corpus statistics: {str(e)}"
  • The @mcp.tool() decorator registers the get_corpus_statistics function as an MCP tool.
    @mcp.tool()
  • Type hints define the input schema (urns: list[str]) and output (str, JSON).
    def get_corpus_statistics(urns: list[str]) -> str:

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