Skip to main content
Glama

bazel_fetch_dependencies

Fetch external dependencies for Bazel build targets to ensure required resources are available before building or testing.

Instructions

Fetch Bazel external dependencies

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetsNoList of specific targets to fetch dependencies for
additionalArgsNoAdditional Bazel command line arguments (e.g. ['--experimental_repository_cache_hardlinks', '--repository_cache=path/to/cache'])

Implementation Reference

  • Core handler function in BazelClient that executes the bazel_fetch_dependencies tool by running 'bazel build fetch //...' or specific targets with validation.
    async fetchDependencies(targets?: string[], additionalArgs?: string[], onOutput?: (chunk: string) => void): Promise<string> {
      const validatedArgs = this.validateAdditionalArgs(additionalArgs);
      const args = ["fetch"];
      if (targets && targets.length > 0) {
        args.push(...targets);
      } else {
        args.push("//...");
      }
      
      args.push(...validatedArgs);
      const { stdout, stderr } = await this.runBazelCommand("build", args, onOutput);
      return `${stdout}\n${stderr}`;
    }
  • Tool schema definition including name, description, and inputSchema for bazel_fetch_dependencies.
    const fetchDependenciesTool: Tool = {
      name: "bazel_fetch_dependencies",
      description: "Fetch Bazel external dependencies",
      inputSchema: {
        type: "object",
        properties: {
          targets: {
            type: "array",
            items: {
              type: "string",
            },
            description: "List of specific targets to fetch dependencies for",
          },
          additionalArgs: {
            type: "array",
            items: {
              type: "string",
            },
            description: "Additional Bazel command line arguments (e.g. ['--experimental_repository_cache_hardlinks', '--repository_cache=path/to/cache'])",
          },
        },
      },
    };
  • index.ts:562-567 (registration)
    Registration of the tool handler in the CallToolRequest switch statement, dispatching to the fetchDependencies method.
    case "bazel_fetch_dependencies": {
      const args = request.params.arguments as unknown as FetchDependenciesArgs;
      log(`Processing bazel_fetch_dependencies`, 'info', false);
      response = await bazelClient.fetchDependencies(args.targets, args.additionalArgs);
      break;
    }
  • index.ts:608-615 (registration)
    Registration of the tool in the ListToolsRequest handler response, including it in the available tools list.
    tools: [
      buildTargetTool,
      queryTargetTool,
      testTargetTool,
      listTargetsTool,
      fetchDependenciesTool,
      setWorkspacePathTool,
    ],
  • TypeScript interface defining the input arguments for the bazel_fetch_dependencies tool.
    interface FetchDependenciesArgs {
      targets?: string[];
      additionalArgs?: string[];
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Fetch' implies a read operation that retrieves dependencies, but the description doesn't specify whether this modifies workspace state, requires network access, has side effects, or what happens when dependencies already exist. For a tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

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 with zero wasted words. It's appropriately sized for a simple tool and gets straight to the point without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (fetching dependencies often involves network operations and workspace state), no annotations, and no output schema, the description is minimally adequate. It states what the tool does but leaves many contextual questions unanswered about behavior, side effects, and results. For a dependency-fetching operation, more context would be helpful.

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 coverage is 100%, so the input schema already fully documents both parameters. The description adds no additional parameter information beyond what's in the schema. This meets the baseline expectation when the schema does the heavy lifting, but provides no extra value.

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 ('fetch') and resource ('Bazel external dependencies'), providing a specific verb+resource combination. However, it doesn't differentiate this tool from its siblings like 'bazel_build_target' or 'bazel_query_target' - all involve Bazel operations but with different purposes.

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. There's no mention of prerequisites, when this operation is needed, or how it differs from other Bazel operations like building or testing targets. The agent must infer usage from the tool name alone.

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/nacgarg/bazel-mcp-server'

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