Skip to main content
Glama

hooks_trigger

Manually trigger predefined hook events on CastPlan MCP to automate workflows, manage project changes, or synchronize sessions with custom data payloads.

Instructions

Trigger a hook event manually

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesEvent data payload
eventTypeYesType of hook event to trigger

Implementation Reference

  • The core handler function for the 'hooks_trigger' tool. It constructs a hook event object from the provided arguments (eventType and data) and calls HooksService.processHookRequest to execute the hook logic.
    tools.set('hooks_trigger', async (args: any) => { return await hooksService.processHookRequest({ event: { type: args.eventType, data: args.data, timestamp: new Date().toISOString() } }); });
  • The input schema definition for the 'hooks_trigger' tool, defining the required eventType (enum) and optional data payload.
    { name: 'hooks_trigger', description: 'Trigger a hook event manually', inputSchema: { type: 'object', properties: { eventType: { type: 'string', enum: ['pre-work', 'post-work', 'file-change', 'session-start', 'session-end'], description: 'Type of hook event to trigger' }, data: { type: 'object', description: 'Event data payload', additionalProperties: true } }, required: ['eventType', 'data'] } },
  • src/index.ts:415-418 (registration)
    Top-level registration of the hooks tools (including 'hooks_trigger') in the main server class. Calls registerHooksTools to populate the tools Map and toolDefinitions array if hooks service is enabled.
    if (this.config.services.hooks && this.hooksService) { const hookTools = registerHooksTools(this.tools, this.hooksService); this.toolDefinitions.push(...hookTools); }

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/Ghostseller/CastPlan_mcp'

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