Skip to main content
Glama

suggest_persona

Analyzes conversation context to recommend appropriate expert personas for AI interactions, activating them only when triggered for efficient responses.

Instructions

대화 컨텍스트를 분석하여 적합한 페르소나를 제안합니다 (트리거 시에만 활성화)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextYes분석할 대화 컨텍스트 또는 질문 내용

Implementation Reference

  • Core handler function that implements the suggest_persona tool logic by analyzing context keywords and usage analytics to recommend a suitable persona.
    async function suggestPersona(context: string): Promise<PersonaSuggestion | null> {
      const personas = await listPersonas();
      if (personas.length === 0) {
        return null;
      }
    
      const analytics = await loadAnalytics();
      const contextLower = context.toLowerCase();
    
      // 컨텍스트 키워드 분석
      const detectionRules = [
        { keywords: ['explain', 'teach', 'learn', 'understand', 'how', 'what', 'why'], persona: 'teacher', weight: 3 },
        { keywords: ['code', 'function', 'bug', 'debug', 'program', 'implement'], persona: 'coder', weight: 3 },
        { keywords: ['professional', 'business', 'formal', 'report', 'meeting'], persona: 'professional', weight: 2 },
        { keywords: ['casual', 'chat', 'friendly', 'hey', 'talk'], persona: 'casual', weight: 2 },
        { keywords: ['brief', 'short', 'quick', 'summary', 'concise'], persona: 'concise', weight: 2 },
      ];
    
      const scores: Record<string, number> = {};
    
      // 규칙 기반 점수
      detectionRules.forEach(rule => {
        if (personas.includes(rule.persona)) {
          const matchCount = rule.keywords.filter(kw => contextLower.includes(kw)).length;
          if (matchCount > 0) {
            scores[rule.persona] = (scores[rule.persona] || 0) + matchCount * rule.weight;
          }
        }
      });
    
      // 과거 사용 패턴 기반 점수 (가중치 낮게)
      const contextKeywords = contextLower.match(/\b\w{4,}\b/g) || [];
      personas.forEach(persona => {
        if (analytics.contextPatterns[persona]) {
          contextKeywords.forEach(kw => {
            if (analytics.contextPatterns[persona][kw]) {
              scores[persona] = (scores[persona] || 0) + 0.5;
            }
          });
        }
      });
    
      // 최고 점수 페르소나 반환
      const sorted = Object.entries(scores).sort((a, b) => b[1] - a[1]);
    
      if (sorted.length > 0 && sorted[0][1] > 1) {
        return {
          persona: sorted[0][0],
          confidence: Math.min(sorted[0][1] / 10, 0.95),
          reason: `Context matches ${sorted[0][0]} pattern`,
        };
      }
    
      return null;
    }
  • Zod schema for validating the input parameters of the suggest_persona tool, specifically the 'context' string.
    export const suggestPersonaSchema = z.object({
      context: z.string().min(1).max(10000),
    });
  • src/index.ts:382-394 (registration)
    Tool registration in the ListToolsRequestHandler, defining the name, description, and input schema for suggest_persona.
      name: 'suggest_persona',
      description: '대화 컨텍스트를 분석하여 적합한 페르소나를 제안합니다 (트리거 시에만 활성화)',
      inputSchema: {
        type: 'object',
        properties: {
          context: {
            type: 'string',
            description: '분석할 대화 컨텍스트 또는 질문 내용',
          },
        },
        required: ['context'],
      },
    },
  • Dispatcher case in CallToolRequestHandler that validates input, calls the suggestPersona handler, and formats the response.
    case 'suggest_persona': {
      const validated = suggestPersonaSchema.parse(args);
      const suggestion = await suggestPersona(validated.context);
    
      if (!suggestion) {
        return {
          content: [
            {
              type: 'text',
              text: '💡 현재 컨텍스트에 적합한 페르소나를 찾을 수 없습니다.\n사용 가능한 페르소나 목록을 보려면 list_personas 도구를 사용하세요.',
            },
          ],
        };
      }
    
      return {
        content: [
          {
            type: 'text',
            text: `💡 페르소나 제안\n\n추천: @persona:${suggestion.persona}\n신뢰도: ${(suggestion.confidence * 100).toFixed(0)}%\n이유: ${suggestion.reason}\n\n이 페르소나를 사용하려면 @persona:${suggestion.persona} 리소스를 참조하세요.`,
          },
        ],
      };
    }
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 'triggered activation only,' which hints at conditional behavior, but doesn't disclose other traits like whether it's read-only, what happens on failure, or if there are rate limits. This leaves significant gaps for a tool that analyzes and suggests.

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 in Korean that conveys the core purpose and a key behavioral note. It's front-loaded with the main action and avoids unnecessary words, making it highly concise and well-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 tool's complexity (analyzing context to suggest personas) and lack of annotations or output schema, the description is insufficient. It doesn't explain what a 'persona' entails, how suggestions are generated, or what the output looks like, leaving the agent with incomplete guidance.

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?

The input schema has 100% description coverage, with the 'context' parameter documented as 'conversation context or question content to analyze.' The description adds no additional parameter details beyond this, so it meets the baseline of 3 without compensating further.

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 tool's purpose: analyzing conversation context to suggest suitable personas. It specifies the action ('analyze' and 'suggest') and resource ('personas'), though it doesn't explicitly differentiate from siblings like 'list_personas' or 'create_persona'.

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

Usage Guidelines3/5

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

The description provides some usage context by mentioning 'triggered activation only,' implying this tool should be used when a specific trigger condition is met. However, it doesn't specify what triggers it or when to use alternatives like 'list_personas' for browsing or 'create_persona' for manual creation.

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