Skip to main content
Glama

mavis_comm_send

Control running sessions by sending commands: prompt, abort, kill, summarize, fork, or spawn.

Instructions

Send a message or command to a running session (prompt/abort/kill/summarize/fork/spawn).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesTarget session ID
commandYesCommand to send
contentNoMessage content (for prompt command)
fromNoSender session ID (default: parent session)

Implementation Reference

  • src/index.js:192-208 (registration)
    Tool registration for mavis_comm_send in the tools array. Defines name, description, inputSchema (with Zod validation for to, command, content, from), and buildArgs that constructs CLI arguments.
    {
      name: 'mavis_comm_send',
      description: 'Send a message or command to a running session (prompt/abort/kill/summarize/fork/spawn).',
      inputSchema: z.object({
        to: z.string().describe('Target session ID'),
        command: z.enum(['prompt', 'abort', 'kill', 'summarize', 'fork', 'spawn']).describe('Command to send'),
        content: z.string().optional().describe('Message content (for prompt command)'),
        from: z.string().optional().describe('Sender session ID (default: parent session)')
      }),
      buildArgs: ({ to, command, content, from }) => {
        const args = ['communication', 'send'];
        if (from) args.push('--from', from);
        args.push('--to', to, '--command', command);
        if (content) args.push('--content', content);
        return args;
      }
    },
  • Generic handler runner. Since mavis_comm_send does NOT define execFn or outputMode, it defaults to execMavisJSON (which calls execMavis and parses JSON output). The buildArgs function constructs the CLI args ['communication', 'send', '--to', to, '--command', command, ...].
    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 }];
      });
    }
  • Zod input schema for mavis_comm_send: 'to' (required string), 'command' (enum of 6 commands), 'content' (optional string), 'from' (optional string).
    inputSchema: z.object({
      to: z.string().describe('Target session ID'),
      command: z.enum(['prompt', 'abort', 'kill', 'summarize', 'fork', 'spawn']).describe('Command to send'),
      content: z.string().optional().describe('Message content (for prompt command)'),
      from: z.string().optional().describe('Sender session ID (default: parent session)')
    }),
  • Core exec helper (execMavis). Spawns the mavis CLI binary. Since 'communication' is in SESSION_COMMANDS, it will append --session with the parent session ID if available.
    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();
      });
    }
Behavior2/5

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

With no annotations, the description bears full responsibility for behavioral disclosure, but it only states the action without mentioning side effects, prerequisites (e.g., session must be running), permissions, or error conditions. This is insufficient for safe use.

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?

The description is a single, efficient sentence that immediately conveys the tool's action. No wasted words.

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?

Given the lack of output schema and annotations, the description does not provide enough context about expected results, errors, or prerequisites. An agent would lack critical information to reliably use this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the description adds no extra meaning beyond what the schema provides. The enum list is repeated, but no additional context or constraints are described.

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

Purpose4/5

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

The description clearly states the tool sends a message or command to a running session and lists the six possible commands. This makes the primary purpose evident, though it does not explicitly differentiate from sibling tools like mavis_session_abort which may cause confusion.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternative tools (e.g., mavis_session_abort) or when not to use it. The description lacks context for appropriate invocation.

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/Cunning-Kang/mavis-mcp-server'

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