Skip to main content
Glama
DynamicEndpoints

Advanced PocketBase MCP Server

health_check

Verify the operational status and connectivity of the Advanced PocketBase MCP Server to ensure it's ready for database interactions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Primary implementation of the health_check tool in the main PocketBaseMCPAgent. Registers the tool with server.tool and provides the async handler function that checks server status and PocketBase health connection.
    this.server.tool(
      'health_check',
      {
        description: 'Check the health status of the MCP server and PocketBase connection'
      },
      async () => {
        const status: Record<string, any> = {
          server: 'healthy',
          timestamp: new Date().toISOString(),
          initialized: this.state.initializationState.pocketbaseInitialized,
          authenticated: this.state.initializationState.isAuthenticated,
          discoveryMode: this.discoveryMode
        };
    
        if (this.pb) {
          try {
            await this.pb.health.check();
            status.pocketbase = 'healthy';
          } catch (error) {
            status.pocketbase = 'unhealthy';
          }
        } else {
          status.pocketbase = 'not initialized';
        }
    
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(status, null, 2)
          }]
        };
      }
    );
  • Handler logic for health_check in the WorkerCompatiblePocketBaseMCPAgent's CallToolRequestHandler switch statement. Returns basic health status.
    case "health_check":
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              status: "healthy",
              initialized: this.initialized,
              pocketbaseConnected: Boolean(this.pb),
              timestamp: new Date().toISOString()
            }, null, 2)
          }
        ]
      };
  • Input schema definition for health_check tool in the list tools response for WorkerCompatiblePocketBaseMCPAgent.
    name: "health_check",
    description: "Check the health status of the MCP server",
    inputSchema: {
      type: "object",
      properties: {},
      required: []
    }
  • Simplified health_check handler in the Cloudflare Worker entry point for quick health checks without full agent initialization.
    if (body.params?.name === 'health_check') {
        return new Response(JSON.stringify({
            jsonrpc: '2.0',
            id: body.id,
            result: {
                content: [{
                        type: 'text',
                        text: JSON.stringify({
                            server: 'healthy',
                            timestamp: new Date().toISOString(),
                            environment: 'cloudflare-worker'
                        }, null, 2)
                    }]
            }
        }), {
            headers: {
                'Content-Type': 'application/json',
                'Access-Control-Allow-Origin': '*'
            }
        });

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/DynamicEndpoints/advanced-pocketbase-mcp-server'

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