Skip to main content
Glama
tifa365

Berlin Open Data MCP Server

by tifa365

berlin_catalog_stats

Analyze Berlin's open data catalog to view total datasets, category distributions, common formats, and popular tags for data discovery and assessment.

Instructions

Gibt einen Ueberblick ueber den gesamten Open-Data-Katalog des Landes Berlin.

Zeigt Gesamtzahl der Datensaetze, Verteilung nach Kategorien,
haeufigste Formate und Tags.

Returns:
    Statistik-Uebersicht des Katalogs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The implementation of the 'berlin_catalog_stats' tool, which queries the CKAN catalog and summarizes statistics.
    async def berlin_catalog_stats() -> str:
        """Gibt einen Ueberblick ueber den gesamten Open-Data-Katalog des Landes Berlin.
    
        Zeigt Gesamtzahl der Datensaetze, Verteilung nach Kategorien,
        haeufigste Formate und Tags.
    
        Returns:
            Statistik-Uebersicht des Katalogs
        """
        try:
            result = await ckan_request(
                "package_search",
                {
                    "q": "*:*",
                    "rows": 0,
                    "facet.field": '["groups", "res_format", "tags"]',
                    "facet.limit": "15",
                },
            )
            total = result["count"]
            facets = result.get("search_facets", result.get("facets", {}))
    
            lines = [
                "## Open Data Katalog – Land Berlin",
                f"**Gesamtzahl Datensaetze**: {total}\n",
                f"**Portal**: {PORTAL_URL}",
                "**Lizenzen**: CC0, CC-BY, Datenlizenz Deutschland (Zero/Namensnennung), GeoNutzV u.a.\n",
            ]
    
            # Groups
            if "groups" in facets:
                lines.append("### Kategorien")
                groups = facets["groups"]
                if isinstance(groups, dict):
                    items = groups.get("items", [])
                else:
                    items = groups if isinstance(groups, list) else []
                for item in sorted(items, key=lambda x: x.get("count", 0), reverse=True):
                    lines.append(f"- **{item.get('display_name', item.get('name', '?'))}**: {item.get('count', 0)}")
  • The registration of the 'berlin_catalog_stats' tool using the mcp.tool decorator.
    @mcp.tool(
        name="berlin_catalog_stats",
        annotations={
            "title": "Katalog-Statistiken",
            "readOnlyHint": True,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": True,
        },
    )

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/tifa365/berlin-opendata-mcp'

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