mavis_hook_list
List all registered Mavis hooks to review pre and post execution triggers. Identify active hooks for debugging or auditing agent workflows.
Instructions
List all registered Mavis hooks (pre/post execution triggers).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.js:77-92 (handler)The runTool function is the generic handler/executor for all tools including mavis_hook_list. It calls buildArgs() to construct CLI args (['hook', 'list']) and then runs execMavisJSON (default) since no execFn is specified, returning the JSON result.
function runTool(spec, parsedArgs) { const { execFn, outputMode, stdin, buildArgs } = spec; const args = buildArgs(parsedArgs); const input = typeof stdin === 'function' ? stdin(parsedArgs) : stdin; const execPromise = execFn ? execMavis(args, input || '') : execMavisJSON(args); return execPromise.then(result => { const text = outputMode === OUTPUT_RAW ? (result || '') : JSON.stringify(result, null, 2); return [{ type: 'text', text }]; }); } - src/index.js:372-377 (schema)Defines mavis_hook_list tool spec including name, description, inputSchema (empty object — no parameters), and buildArgs which returns ['hook', 'list'] CLI command.
{ name: 'mavis_hook_list', description: 'List all registered Mavis hooks (pre/post execution triggers).', inputSchema: z.object({}), buildArgs: () => ['hook', 'list'] }, - src/index.js:473-484 (registration)MavisServer class constructor registers all tools (including mavis_hook_list) via ListToolsRequestSchema and CallToolRequestSchema handlers. The tools array is built at module scope and passed into the server.
class MavisServer { constructor() { this.server = new Server( { name: 'mavis-mcp-server', version: '1.2.0', description: 'Mavis agent team — multi-agent orchestration via MCP', }, { capabilities: { tools: {} } } ); this.toolMap = new Map(tools.map(t => [t.name, t])); - src/index.js:55-64 (helper)execMavisJSON helper used by mavis_hook_list (since it has no execFn, the default path uses execMavisJSON to parse the JSON output from 'mavis hook list' CLI command).
function execMavisJSON(args) { return execMavis(args).then(raw => { try { return JSON.parse(raw); } catch { const jsonStart = raw.indexOf('{'); return JSON.parse(jsonStart >= 0 ? raw.slice(jsonStart) : raw); } }); }