Skip to main content
Glama
zillow
by zillow

getDeepLinks

Query available deep links and intent filters for Android applications to enable automated testing and integration workflows.

Instructions

Query available deep links and intent filters for an Android application

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appIdYesAndroid app package ID to query for deep links

Implementation Reference

  • Registers the "getDeepLinks" MCP tool with ToolRegistry, specifying name, description, input schema, execution handler, and progress support flag.
    ToolRegistry.registerDeviceAware(
      "getDeepLinks",
      "Query available deep links and intent filters for an Android application",
      getDeepLinksSchema,
      getDeepLinksHandler,
      false // Does not support progress notifications
    );
  • The primary handler function for the getDeepLinks tool, instantiates GetDeepLinks class, calls execute, formats response as JSON, and handles errors.
    const getDeepLinksHandler = async (device: BootedDevice, args: GetDeepLinksArgs) => {
      try {
        const getDeepLinks = new GetDeepLinks(device);
        const result = await getDeepLinks.execute(args.appId);
    
        return createJSONToolResponse({
          message: `Discovered deep links for app ${args.appId}`,
          success: result.success,
          appId: result.appId,
          schemes: result.deepLinks.schemes,
          hosts: result.deepLinks.hosts,
          intentFilters: result.deepLinks.intentFilters,
          supportedMimeTypes: result.deepLinks.supportedMimeTypes,
          error: result.error,
          rawOutput: result.rawOutput
        });
      } catch (error) {
        logger.error(`[getDeepLinks] Failed to get deep links: ${error}`);
        throw new ActionableError(`Failed to get deep links: ${error}`);
      }
    };
  • Zod schema defining the input parameters for the getDeepLinks tool: appId (string).
    export const getDeepLinksSchema = z.object({
      appId: z.string().describe("Android app package ID to query for deep links"),
    });
  • GetDeepLinks class providing the core execute method that delegates to DeepLinkManager for querying and parsing deep links, with input validation and error handling.
    export class GetDeepLinks {
      private deepLinkManager: DeepLinkManager;
    
      constructor(device: BootedDevice | null = null) {
        this.deepLinkManager = new DeepLinkManager(device);
      }
    
      /**
       * Execute deep link discovery for an application
       * @param appId - The application package ID to query
       * @returns Promise with deep link discovery results
       */
      async execute(appId: string): Promise<DeepLinkResult> {
        try {
          logger.info(`[GetDeepLinks] Starting deep link discovery for app: ${appId}`);
    
          if (!appId || appId.trim().length === 0) {
            throw new Error("App ID cannot be empty");
          }
    
          const result = await this.deepLinkManager.getDeepLinks(appId);
    
          logger.info(`[GetDeepLinks] Deep link discovery completed for ${appId}. Found ${result.deepLinks.schemes.length} schemes and ${result.deepLinks.hosts.length} hosts`);
    
          return result;
        } catch (error) {
          logger.error(`[GetDeepLinks] Failed to get deep links for ${appId}: ${error}`);
    
          return {
            success: false,
            appId,
            deepLinks: {
              schemes: [],
              hosts: [],
              intentFilters: [],
              supportedMimeTypes: []
            },
            error: error instanceof Error ? error.message : String(error)
          };
        }
      }
    }
  • DeepLinkManager.getDeepLinks method executes 'adb shell dumpsys package' command and calls parser to extract schemes, hosts, intent filters, and MIME types.
    async getDeepLinks(appId: string): Promise<DeepLinkResult> {
      try {
        logger.info(`[DeepLinkManager] Querying deep links for app: ${appId}`);
    
        // Use dumpsys package to get detailed package information including intent filters
        const packageInfoResult = await this.adbUtils.executeCommand(
          `shell dumpsys package ${appId}`
        );
    
        // Parse the results
        const deepLinks = this.parsePackageDumpsysOutput(appId, packageInfoResult.stdout);
    
        return {
          success: true,
          appId,
          deepLinks,
          rawOutput: packageInfoResult.stdout
        };
      } catch (error) {
        logger.error(`[DeepLinkManager] Failed to get deep links for ${appId}: ${error}`);
        return {
          success: false,
          appId,
          deepLinks: {
            schemes: [],
            hosts: [],
            intentFilters: [],
            supportedMimeTypes: []
          },
          error: error instanceof Error ? error.message : String(error)
        };
      }
    }
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 of behavioral disclosure. It mentions querying deep links and intent filters but fails to describe key behaviors: whether this is a read-only operation, what the output format looks like (e.g., list of links, JSON structure), any rate limits, or authentication needs. This is inadequate for a tool with no 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 unnecessary words. It is front-loaded and wastes no space, making it easy for an agent 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?

Given the complexity of querying deep links (which may involve app inspection and data retrieval), the description is insufficient. With no annotations and no output schema, it fails to explain the return values or behavioral traits. The description alone does not provide enough context for an agent to use the tool effectively, especially compared to more complete tool definitions.

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 input schema has 100% description coverage, with the 'appId' parameter clearly documented as 'Android app package ID to query for deep links'. The description does not add any additional meaning beyond this, such as examples or constraints on the appId format. Given the high schema coverage, a baseline score of 3 is appropriate.

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's purpose with a specific verb ('Query') and resource ('available deep links and intent filters for an Android application'), making it easy to understand what the tool does. However, it does not explicitly differentiate this tool from potential siblings like 'openLink' or 'detectIntentChooser', which might also handle deep links in different ways.

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. It lacks context about prerequisites (e.g., needing an installed app), exclusions, or comparisons to sibling tools such as 'openLink' (which might open a link) or 'detectIntentChooser' (which might handle intent detection). This leaves the agent without clear usage direction.

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