Skip to main content
Glama

get_analytics

Retrieve usage statistics for expert personas from local data to analyze engagement and optimize persona switching efficiency.

Instructions

페르소나 사용 통계를 조회합니다 (로컬 데이터만)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler for the 'get_analytics' tool. Loads analytics data from file, sorts and formats usage statistics and top context patterns into a markdown response.
    case 'get_analytics': {
      const analytics = await loadAnalytics();
    
      const usageList = Object.entries(analytics.usage)
        .sort((a, b) => b[1] - a[1])
        .map(([name, count]) => `  ${name}: ${count} uses`)
        .join('\n');
    
      const topPatterns: Record<string, string[]> = {};
      Object.entries(analytics.contextPatterns).forEach(([persona, patterns]) => {
        const sorted = Object.entries(patterns)
          .sort((a, b) => b[1] - a[1])
          .slice(0, 3);
        topPatterns[persona] = sorted.map(([kw]) => kw);
      });
    
      const patternsList = Object.entries(topPatterns)
        .map(([persona, keywords]) => `  ${persona}: ${keywords.join(', ')}`)
        .join('\n');
    
      return {
        content: [
          {
            type: 'text',
            text: `📊 Persona Usage Analytics\n\n사용 횟수:\n${usageList || '  (no data)'}\n\n주요 컨텍스트 패턴:\n${patternsList || '  (no data)'}\n\n💡 이 데이터는 로컬에만 저장되며 전송되지 않습니다.`,
          },
        ],
      };
    }
  • Input schema definition for the 'get_analytics' tool (empty object since no parameters required). Part of the tools list returned by ListToolsRequestSchema.
      name: 'get_analytics',
      description: '페르소나 사용 통계를 조회합니다 (로컬 데이터만)',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Helper function that loads the analytics data from the local JSON file, returning empty defaults if not found. Used by the get_analytics handler.
    async function loadAnalytics(): Promise<Analytics> {
      try {
        const data = await fs.readFile(ANALYTICS_FILE, 'utf-8');
        return JSON.parse(data) as Analytics;
      } catch {
        return { usage: {}, contextPatterns: {} };
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions 'local data only', which adds some context about data scope, but doesn't disclose other behavioral traits like whether it's read-only (implied by '조회합니다' but not explicit), performance characteristics, error conditions, or return format. For a tool with zero annotation coverage, this is insufficient.

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 extremely concise - a single Korean sentence with a brief parenthetical clarification. Every word earns its place by stating the action and a key constraint. It's front-loaded with the main purpose and efficiently structured.

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

Completeness2/5

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

Given the complexity (analytics tool with no output schema and no annotations), the description is incomplete. It doesn't explain what statistics are returned, the format of the data, or any behavioral expectations beyond the local data scope. For a tool that presumably returns structured analytics data, this leaves significant gaps for an AI agent.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100% (though empty). The description doesn't need to compensate for missing parameter documentation. It appropriately doesn't discuss parameters, so a baseline of 4 is warranted as it doesn't add or detract from parameter understanding.

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 verb ('조회합니다' - retrieves/checks) and resource ('페르소나 사용 통계' - persona usage statistics), making the purpose understandable. It distinguishes itself from siblings by focusing on analytics rather than creation, deletion, or listing of personas. However, it doesn't explicitly differentiate from potential analytics siblings that might exist in other contexts.

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 with the parenthetical '(로컬 데이터만)' - 'local data only', which implies a scope limitation. However, it doesn't specify when to use this tool versus alternatives like 'list_personas' for basic listing or other potential analytics tools. No explicit when-not-to-use or alternative tool references are provided.

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/seanshin0214/persona-mcp'

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