Skip to main content
Glama
ShenghaiWang

Android Project MCP Server

by ShenghaiWang

test

Run tests for Android projects to verify functionality and identify issues. Specify the project folder path to execute test suites directly within your development environment.

Instructions

Run test for the Android project in the folder

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderYesThe full path of the current folder that the Android project sits

Implementation Reference

  • Dispatch logic in the call_tool handler that sets the command to execute test.sh for the 'test' tool.
    command = [""]
    if name == "build":
        command = [os.path.join(script_dir, "build.sh"), args.folder]
    elif name == "test":
        command = [os.path.join(script_dir, "test.sh"), args.folder]
    else:
        command = [os.path.join(script_dir, "instrumentedTest.sh"), args.folder]
  • Subprocess execution and result processing logic shared by all tools including 'test', extracting error lines or success message.
    result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False)
    stdout_lines = result.stdout.decode("utf-8").splitlines()
    stderr_lines = result.stderr.decode("utf-8").splitlines()
    all_lines = stdout_lines + stderr_lines
    
    
    error_lines = [line for line in all_lines if "failure: " in line.lower() or "e: " in line.lower() or " failed" in line.lower()]
    error_message = "\n".join(error_lines)
    if not error_message:
        error_message = "Successful"
    return [
        TextContent(type="text", text=f"{error_message}")
        ]
  • Pydantic BaseModel defining the input schema for the 'test' tool: a folder path.
    class Folder(BaseModel):
        """Parameters"""
        folder: Annotated[str, Field(description="The full path of the current folder that the Android project sits")]
  • Registration of the 'test' tool in the list_tools() function.
    Tool(
        name="test",
        description="Run test for the Android project in the folder",
        inputSchema=Folder.model_json_schema(),
    ),
  • Helper to compute the script directory for locating shell scripts like test.sh.
    script_dir = os.path.dirname(os.path.abspath(__file__))

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior2/5

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

No annotations provided, so description must convey behavioral traits. It only says 'Run test', omitting details like side effects (e.g., compilation, output generation), resource usage, or whether it's destructive. Agent lacks critical info for safe invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One succinct sentence with no redundancy. While brief, it is appropriate for a simple tool; front-loads the key action and context.

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 no output schema and sibling tools, description is incomplete. Does not specify what type of tests are run, expected output, or behavior differences from 'instrumentedTest'. Agent lacks sufficient context for robust decision-making.

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 covers the sole parameter 'folder' fully (100%). Description adds no extra meaning beyond the schema, earning baseline score 3.

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?

Description clearly states action ('Run test') and resource ('Android project in the folder'). However, it doesn't differentiate from sibling 'instrumentedTest', which could cause confusion about which test type is executed.

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 on when to use this tool vs. alternatives like 'instrumentedTest'. Context implies it's for running tests, but no exclusions or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools