mavis_agent_info
Retrieve detailed information about an agent, including skills and system prompt.
Instructions
Get detailed info about a specific agent (skills, system prompt, etc.)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agentName | Yes | Agent name |
Implementation Reference
- src/index.js:248-258 (registration)Registration of the 'mavis_agent_info' tool in the tools array. Defines its name, description, input schema (agentName required), and buildArgs function that constructs CLI args ['agent', 'info', agentName].
{ name: 'mavis_agent_info', description: 'Get detailed info about a specific agent (skills, system prompt, etc.)', inputSchema: z.object({ agentName: z.string().describe('Agent name') }), buildArgs: ({ agentName }) => { if (!agentName) throw new Error('agentName is required'); return ['agent', 'info', agentName]; } }, - src/index.js:77-92 (handler)Generic handler function 'runTool' that all tools use. For mavis_agent_info (no execFn), it calls execMavisJSON(['agent', 'info', agentName]) and returns JSON-stringified result as text content.
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:251-253 (schema)Zod input schema for the tool: requires a single string field 'agentName'.
inputSchema: z.object({ agentName: z.string().describe('Agent name') }), - src/index.js:32-63 (helper)Helper functions execMavis and execMavisJSON used to execute the mavis CLI binary. mavis_agent_info uses execMavisJSON (since no execFn is defined), spawning '/Users/cunning/.mavis/bin/mavis agent info <agentName>'.
function execMavis(args, input = '') { return new Promise((resolve, reject) => { const SESSION_COMMANDS = new Set(['communication', 'session', 'spawn']); const sessionId = process.env.__MAVIS_PARENT_SESSION_ID; const subcmd = args[0]; const needsSession = SESSION_COMMANDS.has(subcmd) && sessionId; const finalArgs = needsSession ? [...args, '--session', sessionId] : args; const proc = spawn(MAVIS_BIN, finalArgs, { stdio: ['pipe', 'pipe', 'pipe'] }); let stdout = ''; let stderr = ''; proc.stdout.on('data', d => stdout += d.toString()); proc.stderr.on('data', d => stderr += d.toString()); proc.on('close', code => { if (code === 0) resolve(stdout.trim()); else reject(new Error(stderr.split('\n')[0] || `exit code ${code}`)); }); proc.on('error', reject); if (input) proc.stdin.write(input), proc.stdin.end(); }); } 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); } });