Skip to main content
Glama
zillow
by zillow

setAppSource

Configure source code directory and platform for mobile apps in the AutoMobile automation suite. Specify app ID, source path, and target platform (Android or iOS) for test execution.

Instructions

For a given appId, set the source code path and platform.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceDirYesApp source code directory.
appIdYesApp ID to persist these settings for.
platformYesPlatform the app is built for.

Implementation Reference

  • The handler function for the setAppSource MCP tool. Validates that the appId is installed on the device, sets the app source using ConfigurationManager, logs success, and returns a standardized JSON response.
    async (device: BootedDevice, args: AppSourceArgs): Promise<any> => {
      try {
        const apps = await new ListInstalledApps(device).execute();
        if (apps.find(app => app === args.appId) === undefined) {
          return createJSONToolResponse({
            success: false,
            message: `App ${args.appId} is not installed on device ${device.deviceId}, use listApps and try again.`
          });
        }
    
        // Update configuration with provided parameters
        await ConfigurationManager.getInstance().setAppSource(
          args.appId,
          args.sourceDir,
          args.platform,
          false
        );
    
        // await SourceMapper.getInstance().scanProject(args.appId);
    
        logger.info("App source added successfully");
    
        return createJSONToolResponse({
          success: true,
          message: "App source added successfully"
        });
      } catch (error) {
        logger.error("Failed to configure MCP server:", error);
        const result = {
          success: false,
          message: `Failed to configure MCP server: ${error}`
        };
        return createJSONToolResponse(result);
      }
    }
  • Zod schema defining the input parameters for the setAppSource tool.
    const AppSourceSchema = z.object({
      sourceDir: z.string().describe("App source code directory."),
      appId: z.string().describe("App ID to persist these settings for."),
      platform: z.enum(["android", "ios"]).describe("Platform the app is built for."),
    });
  • Registration of the setAppSource tool using ToolRegistry.registerDeviceAware, which associates the name, description, schema, and handler function.
    ToolRegistry.registerDeviceAware(
      "setAppSource",
      "For a given appId, set the source code path and platform.",
      AppSourceSchema,
      async (device: BootedDevice, args: AppSourceArgs): Promise<any> => {
        try {
          const apps = await new ListInstalledApps(device).execute();
          if (apps.find(app => app === args.appId) === undefined) {
            return createJSONToolResponse({
              success: false,
              message: `App ${args.appId} is not installed on device ${device.deviceId}, use listApps and try again.`
            });
          }
    
          // Update configuration with provided parameters
          await ConfigurationManager.getInstance().setAppSource(
            args.appId,
            args.sourceDir,
            args.platform,
            false
          );
    
          // await SourceMapper.getInstance().scanProject(args.appId);
    
          logger.info("App source added successfully");
    
          return createJSONToolResponse({
            success: true,
            message: "App source added successfully"
          });
        } catch (error) {
          logger.error("Failed to configure MCP server:", error);
          const result = {
            success: false,
            message: `Failed to configure MCP server: ${error}`
          };
          return createJSONToolResponse(result);
        }
      }
    );
  • Helper method in ConfigurationManager that validates the source directory exists, updates the in-memory app config map, and saves the configuration to disk (~/.auto-mobile/config.json).
    public async setAppSource(appId: string, sourceDir: string, platform: "android" | "ios", wipeData: boolean): Promise<void> {
      if (!require("fs").existsSync(sourceDir)) {
        throw new ActionableError(`Source directory does not exist: ${sourceDir}`);
      }
    
      const existing = this.appSourceConfigs.get(appId);
      const newMap = new Map<string, string>();
      const data = wipeData ? newMap : (existing?.data || newMap);
      this.appSourceConfigs.set(appId, { appId, sourceDir, platform, data });
      await this.saveAppConfigs();
    
      logger.debug(`[SOURCE] Set app source: ${appId} -> ${sourceDir}`);
    }
  • Invocation of registerConfigurationTools() during MCP server initialization, which registers the setAppSource tool among others.
    registerConfigurationTools();
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a mutation ('set'), but doesn't specify if this requires specific permissions, whether changes are reversible, or what happens on success/failure. This is inadequate for a mutation tool with zero annotation coverage.

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 directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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?

For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't cover behavioral aspects like side effects, error handling, or return values, leaving significant gaps in understanding how to use the tool effectively in context.

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?

The schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds no additional meaning beyond what's in the schema, such as explaining interactions between parameters or usage examples, resulting in the baseline score for high schema coverage.

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 action ('set') and the target ('source code path and platform') for a specific resource ('appId'), making the purpose understandable. However, it doesn't explicitly differentiate this tool from potential siblings like 'installApp' or 'resetConfig', which might involve app-related operations, so it misses full sibling distinction.

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?

The description provides no guidance on when to use this tool versus alternatives, such as whether it's for initial setup, updates, or specific contexts like development vs. testing. It also lacks prerequisites, like needing an existing app or device configuration, leaving usage unclear.

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/zillow/auto-mobile'

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