Skip to main content
Glama
hongsw

Claude Agents Power

by hongsw

refresh-agents

Update agent templates from a GitHub repository to ensure access to the latest specialized roles for project teams.

Instructions

Refresh agents from GitHub repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler logic for the refresh action within the 'manage-agents' MCP tool. Calls agentManager.refreshAgentsFromGitHub() to refresh the agent cache from GitHub and returns success status.
    case 'refresh': {
      try {
        await agentManager.refreshAgentsFromGitHub();
        const agents = agentManager.getAllAgents();
        
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                success: true,
                count: agents.length,
                message: `Successfully refreshed agents from GitHub. Total agents: ${agents.length}`,
              }, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                success: false,
                error: `Failed to refresh agents: ${error}`,
              }, null, 2),
            },
          ],
        };
      }
    }
  • Core helper function refreshAgentsFromGitHub() that fetches all agents from GitHub repository and updates the local agents cache.
    async refreshAgentsFromGitHub(): Promise<void> {
      const agents = await this.githubIntegration.fetchAllAgentsFromGitHub();
      
      for (const agent of agents) {
        const key = agent.language === 'en' ? agent.name : `${agent.name}-${agent.language}`;
        this.agentsCache.set(key, agent);
      }
      
      if (this.debug) {
        console.error(`[MCP Sub-Agents] Refreshed ${agents.length} agents from GitHub`);
      }
    }
  • Input schema definition for the 'manage-agents' tool in ListTools response, including 'refresh' as one of the possible actions.
      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'],
      },
    },
  • src/index.ts:1543-1558 (registration)
    Registration of the 'manage-agents' tool (which includes refresh functionality) in the MCP server's ListTools response.
                  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'],
            },
          },
        ],
      };
    });
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Refresh agents from GitHub repository' implies a write/mutation operation (updating existing agents), but doesn't specify what gets updated, whether this requires authentication, what happens to existing configurations, or potential side effects. For a tool that likely modifies system state, this is insufficient behavioral context.

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 appropriately sized for a zero-parameter tool and gets straight to the point without unnecessary elaboration. Every word contributes to understanding the tool's purpose.

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?

For a tool that likely performs mutations (refreshing/updating agents), the description is incomplete. With no annotations, no output schema, and minimal behavioral context, important information is missing: what 'refresh' entails, success/failure conditions, authentication requirements, and how this differs from installation. The description doesn't provide enough context for safe, effective use.

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 zero parameters with 100% schema description coverage, so the schema already fully documents the parameter situation. The description doesn't need to compensate for any parameter gaps. A baseline of 4 is appropriate since there are no parameters to explain beyond what the empty schema already indicates.

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 ('Refresh') and resource ('agents from GitHub repository'), making the purpose understandable. However, it doesn't differentiate this tool from sibling tools like 'install-agents' or 'list-agents' - both could involve GitHub repository operations. The description lacks specificity about what 'refresh' means in this context.

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 about when to use this tool versus alternatives. With siblings like 'install-agents', 'list-agents', and 'get-agent-details', there's no indication of when refreshing is appropriate versus installing, listing, or getting details. The description offers no context about prerequisites, timing, or relationship to other operations.

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