mavis_agent_list
Retrieve a list of all available Mavis agents, including built-in and custom agents, to identify which agents can be used for tasks.
Instructions
List all available Mavis agents (built-in and custom).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.js:241-246 (handler)The tool definition for 'mavis_agent_list' in the tools array. handler logic: builds CLI args ['agent', 'list'] which is executed via execMavisJSON (the default, since no execFn is specified), calling the Mavis CLI binary to list all agents.
{ name: 'mavis_agent_list', description: 'List all available Mavis agents (built-in and custom).', inputSchema: z.object({}), buildArgs: () => ['agent', 'list'] }, - src/index.js:484-495 (registration)The tool is registered in the MCP server by being added to the 'tools' array (line 98-467) and then loaded into a toolMap (line 484) used by the CallToolRequestSchema handler (line 494-509) to dispatch incoming tool calls.
this.toolMap = new Map(tools.map(t => [t.name, t])); this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: tools.map(t => ({ name: t.name, description: t.description, inputSchema: normalizeObjectSchema(t.inputSchema), })), })); this.server.setRequestHandler(CallToolRequestSchema, async request => { const { name, arguments: args } = request.params; - src/index.js:77-92 (helper)The runTool helper function that executes the tool. For mavis_agent_list (no execFn defined), it uses execMavisJSON to call the Mavis CLI with args ['agent', 'list'] and returns the JSON output.
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:55-64 (helper)The execMavisJSON helper function that calls the Mavis CLI binary and parses JSON output. Since mavis_agent_list has no execFn, this is the default execution path.
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); } }); }