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: {} }; } }

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