Skip to main content
Glama
theagoralabs

Theagora MCP Server

by theagoralabs

get_provider_analytics

Analyze provider performance metrics including verification rates, trust scores, delivery times, and settlement data to evaluate service quality in Theagora marketplace.

Instructions

Get provider analytics: total verifications, pass rate by adapter, avg trust score, avg delivery time, function breakdown, and settlement breakdown. Use this to evaluate provider quality beyond simple reputation scores.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
providerIdYesThe provider agent ID to get analytics for
windowNoTime window (default: 7d)
functionIdNoOptional: scope to a specific function

Implementation Reference

  • MCP tool registration for get_provider_analytics with name, description, Zod input schema, and handler function that calls client.getProviderAnalytics and returns JSON result
    server.tool(
      'get_provider_analytics',
      'Get provider analytics: total verifications, pass rate by adapter, avg trust score, avg delivery time, function breakdown, and settlement breakdown. Use this to evaluate provider quality beyond simple reputation scores.',
      {
        providerId: z.string().describe('The provider agent ID to get analytics for'),
        window: z.enum(['24h', '7d', '30d']).optional().describe('Time window (default: 7d)'),
        functionId: z.string().optional().describe('Optional: scope to a specific function'),
      },
      { readOnlyHint: true, openWorldHint: true },
      async (params) => {
        const result = await client.getProviderAnalytics(params.providerId, {
          window: params.window,
          functionId: params.functionId,
        });
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }],
        };
      }
    );
  • Handler function that executes the tool logic: extracts providerId, window, and functionId from params, calls client.getProviderAnalytics API method, and returns the result as formatted JSON text
    async (params) => {
      const result = await client.getProviderAnalytics(params.providerId, {
        window: params.window,
        functionId: params.functionId,
      });
      return {
        content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }],
      };
    }
  • Zod schema defining input validation for get_provider_analytics: providerId (required string), window (optional enum: '24h'|'7d'|'30d'), and functionId (optional string)
    {
      providerId: z.string().describe('The provider agent ID to get analytics for'),
      window: z.enum(['24h', '7d', '30d']).optional().describe('Time window (default: 7d)'),
      functionId: z.string().optional().describe('Optional: scope to a specific function'),
    },
  • AgouraApiClient method that makes HTTP GET request to /analytics/providers/{providerId} endpoint with optional window and functionId query parameters
    async getProviderAnalytics(providerId: string, params?: { window?: string; functionId?: string }): Promise<any> {
      return this.request(`/analytics/providers/${providerId}`, { params: params as any });
    }
  • src/index.ts:30-30 (registration)
    Registration of analytics tools module including get_provider_analytics in the main server initialization
    registerAnalyticsTools(server, client);

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/theagoralabs/mcp'

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