Skip to main content
Glama

add_dependency

Add required libraries, tools, or other dependencies to project requests or specific tasks in TaskFlow MCP to ensure all necessary components are available for execution.

Instructions

Add a dependency to a request or task.

Dependencies can be libraries, tools, or other requirements needed for the project or specific tasks.

If 'taskId' is provided, the dependency will be added to that specific task. Otherwise, it will be added to the request.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestIdYes
taskIdNo
dependencyYes

Implementation Reference

  • The handler function that implements the 'add_dependency' tool logic. It extracts the requestId, optional taskId, and dependency from arguments and delegates to the TaskFlowService.addDependency method.
    async add_dependency(args: any) {
      const { requestId, taskId, dependency } = args ?? {};
      return service.addDependency(String(requestId), dependency, taskId ? String(taskId) : undefined);
    },
  • The input schema definition used by the 'add_dependency' tool for validating arguments including requestId, optional taskId, and dependency object.
    inputSchema: {
      type: "object",
      properties: {
        requestId: { type: "string" },
        taskId: { type: "string" },
        dependency: {
          type: "object",
          properties: {
            name: { type: "string" },
            version: { type: "string" },
            url: { type: "string" },
            description: { type: "string" },
          },
          required: ["name"],
        },
      },
      required: ["requestId", "dependency"],
    },
  • Registration of the 'add_dependency' tool (as ADD_DEPENDENCY_TOOL) in the MCP server's list of available tools via ListToolsRequestSchema handler.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        PLAN_TASK_TOOL,
        GET_NEXT_TASK_TOOL,
        MARK_TASK_DONE_TOOL,
        OPEN_TASK_DETAILS_TOOL,
        LIST_REQUESTS_TOOL,
        ADD_TASKS_TO_REQUEST_TOOL,
        UPDATE_TASK_TOOL,
        DELETE_TASK_TOOL,
        ADD_SUBTASKS_TOOL,
        MARK_SUBTASK_DONE_TOOL,
        UPDATE_SUBTASK_TOOL,
        DELETE_SUBTASK_TOOL,
        EXPORT_TASK_STATUS_TOOL,
        ADD_NOTE_TOOL,
        UPDATE_NOTE_TOOL,
        DELETE_NOTE_TOOL,
        ADD_DEPENDENCY_TOOL,
        GET_PROMPTS_TOOL,
        SET_PROMPTS_TOOL,
        UPDATE_PROMPTS_TOOL,
        REMOVE_PROMPTS_TOOL,
        ARCHIVE_COMPLETED_REQUESTS_TOOL,
        LIST_ARCHIVED_REQUESTS_TOOL,
        RESTORE_ARCHIVED_REQUEST_TOOL,
      ],
    }));
  • The supporting service method that performs the actual addition of a dependency to either a request or specific task, handling persistence and status responses.
    public async addDependency(requestId: string, dependency: Dependency, taskId?: string) {
      await this.loadTasks();
      const req = this.getRequest(requestId);
      if (!req) return { status: "error", message: "Request not found" };
    
      if (taskId) {
        const task = req.tasks.find((t) => t.id === taskId);
        if (!task) return { status: "error", message: "Task not found" };
    
        if (!task.dependencies) task.dependencies = [];
        task.dependencies.push(dependency);
        await this.saveTasks();
    
        return {
          status: "dependency_added_to_task",
          message: `Dependency "${dependency.name}" has been added to task ${taskId}.`,
          dependency,
        };
      } else {
        if (!req.dependencies) req.dependencies = [];
        req.dependencies.push(dependency);
        await this.saveTasks();
    
        return {
          status: "dependency_added_to_request",
          message: `Dependency "${dependency.name}" has been added to request ${requestId}.`,
          dependency,
        };
      }
    }
  • Additional schema definition for 'add_dependency' tool inputs, referencing a shared dependencyJson schema.
    add_dependency: {
      type: "object",
      properties: {
        requestId: { type: "string" },
        taskId: { type: "string" },
        dependency: dependencyJson,
      },
      required: ["requestId", "dependency"],
    },
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. It describes the basic action but lacks critical details: whether this is a mutating operation (implied by 'add'), what permissions are required, if there are rate limits, how conflicts are handled, or what the response looks like. For a tool with 3 parameters and nested objects, this is insufficient.

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?

The description is appropriately sized with three sentences that each add value: purpose statement, dependency type clarification, and parameter logic explanation. It's front-loaded with the core purpose. One minor improvement could be combining the first two sentences for even tighter structure.

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 (3 parameters with nested objects, no annotations, no output schema), the description is incomplete. It doesn't explain the response format, error conditions, authentication requirements, or the full parameter semantics. For a mutating tool with significant parameter complexity, this leaves too many unknowns for effective agent use.

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 0%, so the description must compensate. It explains the conditional logic between 'taskId' and request-level addition, and clarifies that dependencies can be 'libraries, tools, or other requirements'. However, it doesn't explain the structure of the 'dependency' object or the purpose of 'requestId', leaving significant gaps. The baseline would be lower without the parameter context provided.

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 verb 'add' and the resource 'dependency', specifying it can be added to either a request or task. It distinguishes from siblings like 'add_note' or 'add_subtasks' by focusing on dependencies. However, it doesn't explicitly differentiate from all siblings, keeping it at 4 instead of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context on when to use this tool: when needing to add dependencies to projects or tasks. It specifies the conditional logic based on 'taskId' presence. However, it doesn't explicitly state when NOT to use it or name specific alternatives among siblings, preventing a score of 5.

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/pinkpixel-dev/taskflow-mcp'

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