Skip to main content
Glama

stop_recording

Ends an active recording on an Android device and saves the captured content to disk for later use or analysis.

Instructions

Stop the active recording and save it to disk.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recording_idYesRecording ID from start_recording

Implementation Reference

  • Registration of the 'stop_recording' MCP tool.
    server.registerTool(
      'stop_recording',
      {
        description: 'Stop the active recording and save it to disk.',
        inputSchema: {
          recording_id: z.string().describe('Recording ID from start_recording'),
        },
      },
      async ({ recording_id }) => {
        const recording = actionRecorder.stopRecording(recording_id);
        return {
          content: [{
            type: 'text' as const,
            text: JSON.stringify({
              success: true,
              recording: {
                id: recording.id,
                name: recording.name,
                actionCount: recording.actions.length,
              },
            }, null, 2),
          }],
        };
      }
    );
  • Actual implementation of the 'stopRecording' logic that stops the recording and saves it to disk.
    stopRecording(recordingId: string): Recording {
      const recording = this.activeRecordings.get(recordingId);
      if (!recording) {
        throw new Error(`No active recording found: ${recordingId}`);
      }
    
      this.activeRecordings.delete(recordingId);
    
      // Save to disk
      const config = getConfig();
      const dir = config.recordingsDir;
      if (!existsSync(dir)) {
        mkdirSync(dir, { recursive: true });
      }
    
      const filename = `${recording.name.replace(/[^a-zA-Z0-9_-]/g, '_')}_${recording.id}.json`;
      const filepath = join(dir, filename);
      writeFileSync(filepath, JSON.stringify(recording, null, 2), 'utf-8');
    
      log.info('Recording saved', { id: recordingId, filepath, actionCount: recording.actions.length });
      return recording;
    }
Behavior3/5

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

With no annotations provided, the description carries full disclosure burden. It successfully notes the persistence behavior ('save it to disk'), but omits error handling (what happens if no active recording exists?), synchronization characteristics, and whether it returns file metadata or path.

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?

Single sentence with zero waste. Information density is high: action (Stop), scope (active), target (recording), and side effect (save to disk) are all front-loaded and essential.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Appropriate for a single-parameter tool with no output schema. Captures core functionality and persistence. Minor gap regarding error state behavior when no recording is active, which would be useful given the lack of annotations.

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 description coverage is 100% ('Recording ID from start_recording'), so the baseline applies. The description itself does not add parameter semantics beyond the schema, but the schema is self-sufficient for the single required parameter.

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

Purpose5/5

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

The description provides a specific verb (Stop), target resource (active recording), and side effect (save to disk). It clearly distinguishes from sibling tools like start_recording, replay_recording, and list_recordings by emphasizing 'active' and the persistence action.

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

Usage Guidelines3/5

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

The phrase 'active recording' implies prerequisite state (recording must be in progress), and the schema references start_recording. However, there is no explicit guidance on when to use versus alternatives, error conditions if called without an active recording, or sequencing requirements.

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/divineDev-dotcom/android_mcp'

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