Skip to main content
Glama

gradle-list

Introspect Android project structure by listing Gradle variants, modules, or tasks to understand build configurations and dependencies.

Instructions

Introspect project structure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationYes
moduleNoe.g., ':app'

Implementation Reference

  • The handler function for the 'gradle-list' tool, which dispatches logic based on the requested operation (modules, variants, or tasks).
    export async function handleGradleListTool(
      input: GradleListInput,
      context: ServerContext
    ): Promise<Record<string, unknown>> {
      switch (input.operation) {
        case "modules": {
          const modules = await context.gradle.listModules();
          return { modules };
        }
    
        case "variants": {
          const variants = await context.gradle.listVariants(input.module);
          return { variants, module: input.module || "all" };
        }
    
        case "tasks": {
          const tasks = await context.gradle.listTasks(input.module);
    
          const listId = context.cache.generateId("tasks");
          context.cache.set(listId, { tasks }, "tasks", CACHE_TTLS.GRADLE_VARIANTS);
    
          const buildTasks = tasks.filter((t) => t.includes("assemble") || t.includes("bundle"));
          const testTasks = tasks.filter((t) => t.includes("test") || t.includes("Test"));
          const cleanTasks = tasks.filter((t) => t.includes("clean"));
    
          return {
            listId,
            summary: {
              totalTasks: tasks.length,
              buildTasks: buildTasks.slice(0, 10),
              testTasks: testTasks.slice(0, 10),
              cleanTasks: cleanTasks.slice(0, 5),
            },
            module: input.module || "all",
          };
        }
    
        default:
          throw new ReplicantError(
            ErrorCode.INVALID_OPERATION,
            `Unknown operation: ${input.operation}`,
            "Valid operations: variants, modules, tasks",
          );
      }
    }
  • Input validation schema for the 'gradle-list' tool.
    export const gradleListInputSchema = z.object({
      operation: z.enum(["variants", "modules", "tasks"]),
      module: z.string().optional(),
    });
  • Tool registration definition for 'gradle-list', containing metadata and input schema description.
    export const gradleListToolDefinition = {
      name: "gradle-list",
      description: "Introspect project structure.",
      inputSchema: {
        type: "object",
        properties: {
          operation: {
            type: "string",
            enum: ["variants", "modules", "tasks"],
          },
          module: { type: "string", description: "e.g., ':app'" },
        },
        required: ["operation"],
      },
      annotations: {
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: false,
      },
    };
Behavior2/5

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

With no annotations provided, the description bears full responsibility for behavioral disclosure but fails to state whether this is read-only, what data format it returns, or if it requires a valid Gradle project context. It omits critical operational context such as performance characteristics or error conditions.

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

Conciseness3/5

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

The description is extremely brief at three words, which technically minimizes verbosity, but constitutes under-specification rather than efficient communication. The single sentence does not earn its place effectively given the tool's functional complexity.

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 supports three distinct listing operations with no output schema or annotations, the description is inadequate as it fails to explain the return values, operational differences between variants/modules/tasks, or filtering capabilities. The gap between description length and functional complexity is significant.

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?

While the schema has only 50% description coverage (missing documentation for the critical 'operation' enum), the description does not compensate by explaining the three operation types (variants, modules, tasks) or when the optional 'module' parameter is required. It fails to add semantic value beyond the schema's basic structure.

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

Purpose3/5

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

The description 'Introspect project structure' conveys a vague sense of inspection but fails to specify the exact resources accessed (modules, variants, tasks) or distinguish this tool from sibling gradle-get-details. It provides a generic verb without clarifying the scope of what is returned.

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 offers no guidance on when to use this tool versus alternatives like gradle-get-details or gradle-build, nor does it specify prerequisites such as when the optional 'module' parameter is required. No contextual conditions or exclusion criteria are provided.

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/thecombatwombat/replicant-mcp'

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