Skip to main content
Glama
hongsw

Claude Agents Power

by hongsw

search-agents

Find precise agent matches by searching with keywords or names. Enables efficient discovery of specialized professionals tailored to specific roles and project needs within your organization.

Instructions

Search for agents by keyword or name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
languageNoLanguage preference (en, kr)en
queryYesSearch query for agents

Implementation Reference

  • Handler for the 'search' action of the 'agents' MCP tool, which implements agent searching by calling agentManager.searchAgents(query) and filtering by language.
          switch (action) {
            case 'search': {
              if (!query) {
                return {
                  content: [
                    {
                      type: 'text',
                      text: JSON.stringify({
                        success: false,
                        error: 'Query is required for search action',
                      }, null, 2),
                    },
                  ],
                };
              }
    
              const agents = agentManager.searchAgents(query);
              const filteredAgents = agents.filter(
                agent => !language || agent.language === language
              );
              
              // Track search event
              trackEvent(AnalyticsEvents.AGENT_SEARCHED, {
                query,
                language,
                found_count: filteredAgents.length,
                auto_create_issue: autoCreateIssue,
              });
              
              // Auto-create issue if no agents found and autoCreateIssue is true
              if (filteredAgents.length === 0 && autoCreateIssue) {
                const githubToken = process.env.GITHUB_TOKEN;
                if (!githubToken) {
                  // Generate GitHub issue creation URL with pre-filled content
                  const issueTitle = encodeURIComponent(`[Agent Request] ${query} - New agent needed`);
                  const issueBodyContent = encodeURIComponent(`## Agent Request
    
    **Role Name**: ${query}
    **Language**: ${language}
    
    ## Description
    ${issueBody || 'A new agent is needed for this role.'}
    
    ## Use Cases
    - [Please describe specific use cases]
    
    ## Required Tools
    - [List required tools like Read, Write, Edit, etc.]
    
    ## Additional Details
    - No existing agents found matching: "${query}"
    - Please consider adding this agent to help users with this use case.`);
                  
                  const createIssueUrl = `https://github.com/hongsw/claude-agents-power-mcp-server/issues/new?title=${issueTitle}&body=${issueBodyContent}&labels=agent-request`;
                  
                  return {
                    content: [
                      {
                        type: 'text',
                        text: JSON.stringify({
                          success: false,
                          error: 'No agents found. GitHub token not configured for auto-issue creation.',
                          suggestion: 'Click the link below to create an issue manually:',
                          createIssueUrl,
                          message: `šŸ” No agents found for "${query}"\n\nšŸ“ You can create an issue manually by clicking this link:\n${createIssueUrl}\n\nšŸ’” Or set GITHUB_TOKEN environment variable for automatic issue creation.`,
                        }, null, 2),
                      },
                    ],
                  };
                }
    
                try {
                  const issueTitle = `[Agent Request] ${query} - New agent needed`;
                  const issueBodyContent = `## Agent Request
    
    **Role Name**: ${query}
    **Language**: ${language}
    
    ## Description
    ${issueBody || 'A new agent is needed for this role.'}
    
    ## Use Cases
    - [Please describe specific use cases]
    
    ## Required Tools
    - [List required tools like Read, Write, Edit, etc.]
    
    ## Additional Details
    - Requested via MCP server auto-issue creation
    - No existing agents found matching: "${query}"
    
    ---
    *This issue was automatically created by claude-agents-power MCP server*`;
    
                  const response = await fetch('https://api.github.com/repos/hongsw/claude-agents-power-mcp-server/issues', {
                    method: 'POST',
                    headers: {
                      'Authorization': `token ${githubToken}`,
                      'Accept': 'application/vnd.github+json',
                      'Content-Type': 'application/json',
                    },
                    body: JSON.stringify({
                      title: issueTitle,
                      body: issueBodyContent,
                      labels: ['agent-request', 'auto-created'],
                    }),
                  });
    
                  if (!response.ok) {
                    throw new Error(`GitHub API error: ${response.status} ${response.statusText}`);
                  }
    
                  const issue = await response.json();
                  
                  // Log to stderr for visibility
                  console.error(`[MCP Sub-Agents] āœ… GitHub issue created successfully!`);
                  console.error(`[MCP Sub-Agents] Issue #${issue.number}: ${issue.html_url}`);
                  
                  // Track issue creation
                  trackEvent(AnalyticsEvents.AGENT_ISSUE_CREATED, {
                    query,
                    language,
                    issue_number: issue.number,
                    issue_url: issue.html_url,
                  });
                  
                  return {
                    content: [
                      {
                        type: 'text',
                        text: JSON.stringify({
                          success: true,
                          count: 0,
                          message: `šŸ” No agents found for "${query}"\n\nšŸ“ GitHub issue automatically created!\n\nšŸ”— Issue #${issue.number}: ${issue.title}\nšŸ“Ž ${issue.html_url}\n\nšŸ’” The maintainers will review and potentially add this agent.\nšŸ“š Meanwhile, you can create your own agent following the guide.`,
                          issueUrl: issue.html_url,
                          issueNumber: issue.number,
                          nextSteps: [
                            'Wait for maintainers to review the issue',
                            'Create your own agent following the documentation',
                            'Check back later for the new agent'
                          ]
                        }, null, 2),
                      },
                    ],
                  };
                } catch (error) {
                  return {
                    content: [
                      {
                        type: 'text',
                        text: JSON.stringify({
                          success: false,
                          count: 0,
                          error: `Failed to create issue: ${error}`,
                          suggestion: 'Visit https://github.com/hongsw/claude-agents-power-mcp-server/issues to manually create an issue',
                        }, null, 2),
                      },
                    ],
                  };
                }
              }
              
              // If no agents found and autoCreateIssue is false, provide manual creation link
              if (filteredAgents.length === 0) {
                const issueTitle = encodeURIComponent(`[Agent Request] ${query} - New agent needed`);
                const issueBodyContent = encodeURIComponent(`## Agent Request
    
    **Role Name**: ${query}
    **Language**: ${language}
    
    ## Description
    A new agent is needed for this role.
    
    ## Use Cases
    - [Please describe specific use cases]
    
    ## Required Tools
    - [List required tools like Read, Write, Edit, etc.]
    
    ## Additional Details
    - No existing agents found matching: "${query}"
    - Please consider adding this agent to help users with this use case.`);
                
                const createIssueUrl = `https://github.com/hongsw/claude-agents-power-mcp-server/issues/new?title=${issueTitle}&body=${issueBodyContent}&labels=agent-request`;
                
                return {
                  content: [
                    {
                      type: 'text',
                      text: JSON.stringify({
                        success: true,
                        count: 0,
                        agents: [],
                        message: `šŸ” No agents found for "${query}"`,
                        suggestion: 'šŸ“ You can request this agent by creating an issue:',
                        createIssueUrl,
                        tip: 'šŸ’” Set autoCreateIssue=true to automatically create issues when agents are not found.',
                      }, null, 2),
                    },
                  ],
                };
              }
              
              return {
                content: [
                  {
                    type: 'text',
                    text: JSON.stringify({
                      success: true,
                      count: filteredAgents.length,
                      agents: filteredAgents.map(agent => ({
                        name: agent.name,
                        description: agent.description,
                        tools: agent.tools,
                        language: agent.language,
                      })),
                    }, null, 2),
                  },
                ],
              };
            }
  • Input schema definition for the 'agents' MCP tool, which supports 'search' action for searching agents.
      name: 'agents',
      description: 'Search, list, get details, recommend agents, or request new ones',
      inputSchema: {
        type: 'object',
        properties: {
          action: {
            type: 'string',
            description: 'Action to perform',
            enum: ['search', 'list', 'details', 'recommend', 'request'],
          },
          query: {
            type: 'string',
            description: 'Search query (for search action) or agent name (for details action)',
          },
          keywords: {
            type: 'array',
            items: { type: 'string' },
            description: 'Keywords for recommendation (for recommend action)',
          },
          language: {
            type: 'string',
            description: 'Language preference',
            enum: ['en', 'ko', 'ja', 'zh'],
            default: 'en',
          },
          category: {
            type: 'string',
            description: 'Filter by category (for list action)',
            enum: ['development', 'data', 'design', 'management', 'marketing', 'operations', 'hr', 'finance', 'legal', 'research', 'healthcare', 'education', 'media', 'manufacturing', 'other'],
          },
          autoCreateIssue: {
            type: 'boolean',
            description: 'Auto-create GitHub issue if no agents found (for search action)',
            default: false,
          },
          issueBody: {
            type: 'string',
            description: 'Additional details for the issue (when autoCreateIssue is true)',
          },
        },
        required: ['action'],
      },
    },
  • src/index.ts:1384-1558 (registration)
    Registration of all MCP tools including 'agents' tool via ListToolsRequestSchema handler.
      server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: 'analyze-project',
            description: 'Analyze a project directory and recommend suitable sub-agents',
            inputSchema: {
              type: 'object',
              properties: {
                projectPath: {
                  type: 'string',
                  description: 'Path to the project directory to analyze',
                },
              },
              required: ['projectPath'],
            },
          },
          {
            name: 'ai-analyze-project',
            description: 'Perform AI-powered comprehensive project analysis and agent recommendations',
            inputSchema: {
              type: 'object',
              properties: {
                claudeMdPath: {
                  type: 'string',
                  description: 'Path to CLAUDE.md file or project description',
                },
                projectPath: {
                  type: 'string',
                  description: 'Optional path to project root directory (defaults to CLAUDE.md directory)',
                },
                generateRecommendations: {
                  type: 'boolean',
                  description: 'Whether to generate agent recommendations',
                  default: true,
                },
                maxRecommendations: {
                  type: 'number',
                  description: 'Maximum number of agent recommendations to return',
                  default: 10,
                },
              },
              required: ['claudeMdPath'],
            },
          },
          {
            name: 'agent-download',
            description: 'AI-powered agent downloader - analyze project and download recommended agents',
            inputSchema: {
              type: 'object',
              properties: {
                targetDir: {
                  type: 'string',
                  description: 'Target directory for agent files',
                  default: './.claude/agents',
                },
                claudeMdPath: {
                  type: 'string',
                  description: 'Path to CLAUDE.md file',
                  default: './CLAUDE.md',
                },
                format: {
                  type: 'string',
                  enum: ['md', 'yaml', 'json'],
                  description: 'Agent file format',
                  default: 'md',
                },
                language: {
                  type: 'string',
                  enum: ['en', 'ko', 'ja', 'zh'],
                  description: 'Preferred language for agents',
                  default: 'en',
                },
                limit: {
                  type: 'number',
                  description: 'Maximum number of agents to download',
                  default: 10,
                  minimum: 1,
                  maximum: 20,
                },
                dryRun: {
                  type: 'boolean',
                  description: 'Preview recommendations without downloading',
                  default: false,
                },
                overwrite: {
                  type: 'boolean',
                  description: 'Overwrite existing agent files',
                  default: false,
                },
              },
            },
          },
          {
            name: 'agents',
            description: 'Search, list, get details, recommend agents, or request new ones',
            inputSchema: {
              type: 'object',
              properties: {
                action: {
                  type: 'string',
                  description: 'Action to perform',
                  enum: ['search', 'list', 'details', 'recommend', 'request'],
                },
                query: {
                  type: 'string',
                  description: 'Search query (for search action) or agent name (for details action)',
                },
                keywords: {
                  type: 'array',
                  items: { type: 'string' },
                  description: 'Keywords for recommendation (for recommend action)',
                },
                language: {
                  type: 'string',
                  description: 'Language preference',
                  enum: ['en', 'ko', 'ja', 'zh'],
                  default: 'en',
                },
                category: {
                  type: 'string',
                  description: 'Filter by category (for list action)',
                  enum: ['development', 'data', 'design', 'management', 'marketing', 'operations', 'hr', 'finance', 'legal', 'research', 'healthcare', 'education', 'media', 'manufacturing', 'other'],
                },
                autoCreateIssue: {
                  type: 'boolean',
                  description: 'Auto-create GitHub issue if no agents found (for search action)',
                  default: false,
                },
                issueBody: {
                  type: 'string',
                  description: 'Additional details for the issue (when autoCreateIssue is true)',
                },
              },
              required: ['action'],
            },
          },
          {
            name: 'manage-agents',
            description: 'Install agents, get stats, or refresh from GitHub',
            inputSchema: {
              type: 'object',
              properties: {
                action: {
                  type: 'string',
                  description: 'Management action to perform',
                  enum: ['install', 'stats', 'refresh', 'version'],
                },
                agentNames: {
                  type: 'array',
                  items: { type: 'string' },
                  description: 'Agent names to install (for install action)',
                },
                targetPath: {
                  type: 'string',
                  description: 'Target directory for installation (for install action)',
                },
                language: {
                  type: 'string',
                  description: 'Language preference for agents',
                  enum: ['en', 'ko', 'ja', 'zh'],
                  default: 'en',
                },
                limit: {
                  type: 'number',
                  description: 'Number of top agents to show in stats',
                  default: 10,
                },
              },
              required: ['action'],
            },
          },
        ],
      };
    });
  • Core helper function searchAgents that performs fuzzy search on agent names and descriptions in the cache.
    searchAgents(query: string): Agent[] {
      const results: Agent[] = [];
      const lowerQuery = query.toLowerCase();
      
      for (const agent of this.agentsCache.values()) {
        if (
          agent.name.toLowerCase().includes(lowerQuery) ||
          agent.description.toLowerCase().includes(lowerQuery)
        ) {
          results.push(agent);
        }
      }
      
      return results;
    }
  • Instantiation of AgentManager used by the agents tool handlers.
    const agentManager = new AgentManager(agentsPath, {
      owner: 'baryonlabs',
      repo: 'claude-sub-agent-contents',
      branch: 'main',
      path: 'claude/agents'
    }, cliOptions.debug || false);
    const aiAnalysisService = new AIAnalysisService();
    
    // Function to setup tools for a server instance
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 states the tool searches for agents but doesn't disclose behavioral traits such as whether it's read-only (likely, but not confirmed), how results are returned (e.g., pagination, format), or any limitations (e.g., rate limits, authentication needs). This is a significant gap for a search tool with no annotation coverage.

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 with zero waste. It's front-loaded with the core purpose and appropriately sized for a simple search tool, making it easy to parse quickly.

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 (a search tool with 2 parameters), no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., a list of agents, their details), how results are structured, or any behavioral constraints. This leaves gaps for an AI agent to use the tool effectively without additional context.

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?

Schema description coverage is 100%, so the schema already documents both parameters ('query' for search and 'language' with enum values). The description adds minimal value beyond the schema by implying the 'query' parameter is for 'keyword or name' searching, but it doesn't provide additional syntax, format details, or context beyond what the schema specifies. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('Search for agents') and resource ('agents'), specifying it's by 'keyword or name'. It distinguishes from siblings like 'list-agents' (which presumably lists without search) and 'get-agent-details' (which gets details for a specific agent). However, it doesn't explicitly differentiate from 'recommend-by-keywords', which might be a more specific recommendation tool.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention when to prefer 'search-agents' over 'list-agents' (e.g., for filtered results) or 'recommend-by-keywords' (e.g., for recommendations vs. general search). The description implies usage for searching but lacks explicit context or exclusions.

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

Related 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/hongsw/pair-role-mcp-server'

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