Skip to main content
Glama
dcarter610
by dcarter610

audio_playback

Control playback of local audio files to simulate human speech input for automated testing in Android emulators.

Instructions

Control playback of local audio files for automated testing. Audio is played via a virtual audio output device that is routed into the Android emulator's microphone. Use this to simulate a human speaking into the mic by playing prerecorded files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes
filenameNo
start_offset_msNo
list_limitNo

Implementation Reference

  • The `audio_playback` tool handler is defined using the `@server.tool` decorator within `_build_server`. It processes playback actions by delegating to an `AudioPlaybackManager` instance.
    @server.tool(
        name="audio_playback",
        description=(
            "Control playback of local audio files for automated testing. Audio is "
            "played via a virtual audio output device that is routed into the Android "
            "emulator's microphone. Use this to simulate a human speaking into the mic "
            "by playing prerecorded files."
        ),
    )
    async def audio_playback(
        action: Literal["play", "stop", "pause", "resume", "status", "list_files"],
        filename: Optional[str] = None,
        start_offset_ms: int = 0,
        list_limit: int = 200,
    ) -> dict:
        if action == "play" and (filename is None or not filename.strip()):
            return {
                "success": False,
                "message": "filename is required for 'play' action.",
                "state": manager.state,
            }
    
        if start_offset_ms < 0:
            return {
                "success": False,
                "message": "start_offset_ms must be non-negative.",
                "state": manager.state,
            }
    
        try:
            if action == "play":
                success, message, state = await manager.play(
                    filename=filename or "",
                    start_offset_ms=start_offset_ms,
                )
                return {"success": success, "message": message, "state": state}
    
            if action == "stop":
                success, message, state = await manager.stop()
                return {"success": success, "message": message, "state": state}
    
            if action == "pause":
                success, message, state = await manager.pause()
                return {"success": success, "message": message, "state": state}
    
            if action == "resume":
                success, message, state = await manager.resume()
                return {"success": success, "message": message, "state": state}
    
            if action == "status":
                success, message, state = await manager.status()
                return {"success": success, "message": message, "state": state}
    
            files_payload = manager.list_local_files(limit=list_limit)
            return {
                "success": True,
                "message": "Listed files available under AUDIO_ROOT_DIR.",
                "state": manager.state,
                "files": files_payload,
            }
        except ValueError as exc:
            return {"success": False, "message": str(exc), "state": manager.state}
    
    return server
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool controls playback for testing via a virtual device, which hints at non-destructive and system-specific behavior, but lacks details on permissions, rate limits, error handling, or what 'status' and 'list_files' actions return. For a tool with 4 parameters and no annotations, this is a significant gap in behavioral context.

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 appropriately sized and front-loaded, with two sentences that efficiently convey purpose and usage without waste. Every sentence earns its place by introducing the tool's function and its specific testing application, making it easy to scan and understand.

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 tool's complexity (4 parameters, no annotations, no output schema), the description is incomplete. It covers the high-level purpose and testing context but lacks details on behavioral traits, parameter meanings, and return values, which are crucial for an agent to use the tool effectively in an automated testing scenario.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for parameter documentation. It mentions 'playing prerecorded files', which relates to the 'filename' parameter, but does not explain the semantics of 'action' enum values (e.g., what 'status' returns), 'start_offset_ms', or 'list_limit'. With 4 parameters and low coverage, the description adds minimal value beyond the schema.

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 clearly states the tool's purpose with specific verbs ('control playback') and resources ('local audio files'), and distinguishes its unique context ('for automated testing', 'via a virtual audio output device', 'routed into the Android emulator's microphone', 'to simulate a human speaking into the mic'). It goes beyond the tool name by explaining the testing scenario and routing mechanism.

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 description implies usage context ('for automated testing', 'to simulate a human speaking into the mic by playing prerecorded files'), which gives a clear when-to-use scenario. However, it does not provide explicit alternatives, exclusions, or prerequisites, and there are no sibling tools mentioned for comparison, limiting guidance to implicit context only.

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/dcarter610/MCP-Virtual-Audio-Player'

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