Skip to main content
Glama

trigger_command

Trigger a single Hotkeyless command by its exact name, with automatic blacklist enforcement and existence verification, to execute predefined automation tasks.

Instructions

Trigger one Hotkeyless command by exact name using /trigger. Enforces blacklist and verifies command exists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesExact command name returned by discover_commands.

Implementation Reference

  • CommandExecutionService.trigger() — the core handler that validates the command against the blacklist, looks it up via discovery, and delegates to the HTTP client.
      public async trigger(command: string): Promise<EndpointActionResult> {
        if (this.safety.isBlocked(command)) {
          throw new CommandBlockedError(command);
        }
    
        const availableCommands = await this.discoveryService.getCommands();
        const normalizedInput = normalizeCommandForComparison(command);
        const matchedCommand = availableCommands.find(
          (entry) => normalizeCommandForComparison(entry.command) === normalizedInput,
        );
        if (!matchedCommand) {
          throw new CommandNotFoundError(command);
        }
    
        return this.client.triggerCommand({ command: matchedCommand.command });
      }
    
      public async sendKeys(input: SendKeysRequest): Promise<EndpointActionResult> {
        return this.client.sendKeys(input);
      }
    
      public async mouseMove(input: MouseMoveRequest): Promise<EndpointActionResult> {
        return this.client.mouseMove(input);
      }
    }
  • HotkeylessAhkClient.triggerCommand() — makes the actual HTTP GET request to the /trigger endpoint.
      public async triggerCommand(payload: TriggerRequest): Promise<EndpointActionResult> {
        return this.requestJson(`${this.config.endpoints.trigger}${this.buildUrl(payload.command)}`, {
          method: 'GET',
          body: JSON.stringify(payload.params ?? {}),
        });
      }
    
      private async tryOptionalEndpoint(
        payload: unknown,
        endpointName: string,
      ): Promise<EndpointActionResult> {
        const obj: TriggerRequest = {
            command: endpointName,
            params: payload as Record<string, unknown>,
        }
        return this.triggerCommand(obj);
      }
    
      public async sendKeys(payload: SendKeysRequest): Promise<EndpointActionResult> {
        return this.tryOptionalEndpoint(payload, 'send_keys');
      }
    
      public async mouseMove(payload: MouseMoveRequest): Promise<EndpointActionResult> {
        return this.tryOptionalEndpoint(payload, 'mouse_move');
      }
    }
  • Registration of the 'trigger_command' tool with name, description, input schema (command string), and the async handler that calls executionService.trigger().
    server.registerTool(
      'trigger_command',
      {
        description:
          'Trigger one Hotkeyless command by exact name using /trigger. Enforces blacklist and verifies command exists.',
        inputSchema: {
          command: z
            .string()
            .trim()
            .min(1)
            .describe('Exact command name returned by discover_commands.'),
        },
      },
      async ({ command }) => {
        logInfo('tool.trigger_command.start', {
          command,
        });
    
        try {
          const result = await executionService.trigger(command);
          logInfo('tool.trigger_command.success', {
            command,
            status: result.status,
          });
    
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(
                  {
                    status: result.status,
                    ok: true,
                    response: result.body,
                  },
                  null,
                  2,
                ),
              },
            ],
          };
        } catch (error) {
          logError('tool.trigger_command.failure', error, {
            command,
          });
          return toErrorResult(error);
        }
      },
    );
  • TriggerRequest type definition used by the trigger command.
    export interface TriggerRequest {
      command: string;
      params?: Record<string, unknown>;
    }
  • BlacklistSafety — helper class that checks if a command is blocked before triggering.
    import { normalizeCommandForComparison } from '@/domain/commands';
    
    export class BlacklistSafety {
      private readonly blacklistSet: Set<string>;
    
      public constructor(blacklist: string[]) {
        this.blacklistSet = new Set(blacklist.map((item) => normalizeCommandForComparison(item)));
      }
    
      public isBlocked(command: string): boolean {
        return this.blacklistSet.has(normalizeCommandForComparison(command));
      }
    }
Behavior2/5

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

No annotations provided, so description must disclose behavior fully. It mentions blacklist enforcement and existence verification but omits success/failure outcomes, side effects, permissions, or return values.

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?

Two short sentences, no filler, front-loaded with key action and constraints. Every word contributes.

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?

Missing crucial details: no output schema, no description of return values or behavior after triggering. Agent cannot infer outcomes, making the description inadequate for a mutation-like tool.

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?

Schema coverage is 100% with param description. Description adds context: exact name requirement, /trigger usage, blacklist and existence checks, enhancing beyond the schema baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states verb 'Trigger' and resource 'one Hotkeyless command', with method '/trigger'. It distinguishes from siblings: discover_commands lists commands, mouse_move and send_keys are different actions.

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

Usage Guidelines4/5

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

Implies usage: call with exact name from discover_commands, but no explicit when-not or alternatives. The sibling context helps, but description lacks negative guidance.

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/tim0-12432/HotkeylessAHK-mcp-skill'

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