Skip to main content
Glama
theagoralabs

Theagora MCP Server

by theagoralabs

get_function_details

Read-only

Retrieve detailed information about a specific function, including provider reputation metrics, by providing its function ID (fid).

Instructions

Get detailed information about a specific function including provider reputation metrics. Provide the function ID (fid) to look up.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fidYesThe function ID (fid) to look up

Implementation Reference

  • The main handler implementation for get_function_details. Takes a function ID (fid), lists all functions to find the matching one, fetches provider reputation for that function, and returns both the function details and provider reputation as JSON.
    async (params) => {
      // List functions and find the matching one
      const allFunctions = await client.listFunctions();
      const fn = Array.isArray(allFunctions)
        ? allFunctions.find((f: any) => f.fid === params.fid)
        : null;
    
      if (!fn) {
        return {
          content: [{ type: 'text' as const, text: `Function "${params.fid}" not found.` }],
          isError: true,
        };
      }
    
      // Also fetch provider reputation
      let reputation = null;
      try {
        reputation = await client.getReputation(fn.provider.agentId, {
          functionId: params.fid,
        });
      } catch {
        // Reputation may not be available yet
      }
    
      return {
        content: [{
          type: 'text' as const,
          text: JSON.stringify({ function: fn, providerReputation: reputation }, null, 2),
        }],
      };
    }
  • Input schema definition for get_function_details tool. Defines a single required parameter 'fid' (string) which is the function ID to look up.
    {
      fid: z.string().describe('The function ID (fid) to look up'),
    },
  • Complete registration of the get_function_details tool with the MCP server. Includes the tool name, description, input schema, hints (readOnlyHint, openWorldHint), and the async handler function.
    server.tool(
      'get_function_details',
      'Get detailed information about a specific function including provider reputation metrics. Provide the function ID (fid) to look up.',
      {
        fid: z.string().describe('The function ID (fid) to look up'),
      },
      { readOnlyHint: true, openWorldHint: true },
      async (params) => {
        // List functions and find the matching one
        const allFunctions = await client.listFunctions();
        const fn = Array.isArray(allFunctions)
          ? allFunctions.find((f: any) => f.fid === params.fid)
          : null;
    
        if (!fn) {
          return {
            content: [{ type: 'text' as const, text: `Function "${params.fid}" not found.` }],
            isError: true,
          };
        }
    
        // Also fetch provider reputation
        let reputation = null;
        try {
          reputation = await client.getReputation(fn.provider.agentId, {
            functionId: params.fid,
          });
        } catch {
          // Reputation may not be available yet
        }
    
        return {
          content: [{
            type: 'text' as const,
            text: JSON.stringify({ function: fn, providerReputation: reputation }, null, 2),
          }],
        };
      }
    );
  • Helper method listFunctions() called by get_function_details handler. Makes an API request to /functions endpoint with optional query parameters (q, minPrice, maxPrice, sort, provider).
    async listFunctions(params?: {
      q?: string;
      minPrice?: number;
      maxPrice?: number;
      sort?: string;
      provider?: string;
    }): Promise<any> {
      return this.request('/functions', { params: params as any });
    }
  • Helper method getReputation() called by get_function_details handler. Makes an API request to /agents/{agentId}/reputation endpoint with optional functionId, dateFrom, and dateTo parameters to fetch provider reputation metrics.
    async getReputation(agentId: string, params?: {
      functionId?: string;
      dateFrom?: string;
      dateTo?: string;
    }): Promise<any> {
      return this.request(`/agents/${agentId}/reputation`, { params: params as any });
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations indicate read-only and open-world hints, which the description doesn't contradict. It adds value by specifying that the tool includes 'provider reputation metrics' in the output, which is useful behavioral context beyond the annotations. However, it lacks details on response format, error handling, or rate limits, limiting its transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose and includes key details like the parameter requirement. There's no redundant information, and every word contributes to clarity, making it appropriately concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, read-only, no output schema), the description is adequate but incomplete. It covers the basic action and parameter but lacks output details, error scenarios, or integration with sibling tools. With annotations providing safety context, it's minimally viable but could be more comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the input schema fully documents the single parameter (fid). The description mentions the parameter but doesn't add semantic details beyond what's in the schema, such as format examples or constraints. This meets the baseline for high schema coverage without extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get detailed information') and the resource ('a specific function including provider reputation metrics'), making the purpose understandable. However, it doesn't explicitly differentiate this tool from potential siblings like 'get_function_analytics' or 'my_functions', which might also retrieve function-related data, so it falls short of a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides minimal guidance by mentioning the required parameter (function ID) but offers no explicit advice on when to use this tool versus alternatives such as 'get_function_analytics' or 'my_functions'. There's no context on prerequisites, typical use cases, or exclusions, leaving usage unclear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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