Skip to main content
Glama

list_courts

Retrieve details of available courts and their document counts to access Swiss legal decisions via the entscheidsuche.ch API.

Instructions

Get information about available courts and their document counts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'list_courts' tool. Calls client.getCourtStatus() to fetch court statuses, formats as JSON text response, handles errors.
    async () => { try { const courts = await client.getCourtStatus(); return { content: [ { type: "text", text: `Available Courts:\n\n${JSON.stringify(courts, null, 2)}` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error retrieving court information: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } }
  • TypeScript interface defining the structure of court status objects returned by the tool.
    interface CourtStatus { name: string; total_documents: number; new_documents: number; last_run: string; status: string; }
  • src/index.ts:343-373 (registration)
    Registration of the 'list_courts' tool with server.registerTool, providing title, description, empty input schema, and handler reference.
    server.registerTool( "list_courts", { title: "List Available Courts", description: "Get information about available courts and their document counts", inputSchema: {} }, async () => { try { const courts = await client.getCourtStatus(); return { content: [ { type: "text", text: `Available Courts:\n\n${JSON.stringify(courts, null, 2)}` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error retrieving court information: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } } );
  • Supporting method getCourtStatus() in EntscheidungsucheClient class, currently provides mock data for court statuses.
    async getCourtStatus(): Promise<CourtStatus[]> { // This would need to be implemented by scraping the status page // For now, return a mock response return [ { name: "Bundesgericht", total_documents: 15000, new_documents: 45, last_run: "2024-01-15", status: "Komplett gelesen" } ]; }

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/self-tech-labs/entscheidsuche-MCP-server'

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