Skip to main content
Glama

agent_switch_quick

Switch between predefined agent roles like IT, hacker, sales, or color-coded teams to adapt AI behavior for specific tasks.

Instructions

Quick switch agent using shorthand (it/hacker/sales/blue/red/purple)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesQuick switch type

Implementation Reference

  • src/index.ts:363-377 (registration)
    Registers the 'agent_switch_quick' tool including its input schema for quick agent switching using shorthand names.
    {
      name: 'agent_switch_quick',
      description: 'Quick switch agent using shorthand (it/hacker/sales/blue/red/purple)',
      inputSchema: {
        type: 'object',
        properties: {
          type: {
            type: 'string',
            enum: ['it', 'hacker', 'sales', 'blue', 'red', 'purple'],
            description: 'Quick switch type'
          }
        },
        required: ['type']
      }
    },
  • Tool handler that initializes AgentManager, performs quick switch via am.quickSwitch(type), validates success, and returns confirmation with active agent name.
    case 'agent_switch_quick': {
      await am.initialize();
      const { type } = args as any;
      const success = am.quickSwitch(type);
      
      if (!success) {
        throw new Error(`Invalid agent type: ${type}`);
      }
      
      const activeAgent = am.getActiveAgent();
      return {
        content: [
          {
            type: 'text',
            text: `✅ Switched to ${activeAgent?.name}`
          }
        ]
      };
    }
  • Core logic of agent_switch_quick: maps shorthand types to full agent IDs and delegates to setActiveAgent, returning success boolean.
    quickSwitch(type: 'it' | 'hacker' | 'sales' | 'blue' | 'red' | 'purple'): boolean {
      const mapping: Record<string, string> = {
        'it': 'it-expert',
        'hacker': 'ethical-hacker',
        'sales': 'sales-expert',
        'blue': 'blue-team',
        'red': 'red-team',
        'purple': 'purple-team'
      };
    
      const id = mapping[type];
      if (id) {
        return this.setActiveAgent(id);
      }
      return false;

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/hlsitechio/mcp-instruct'

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