Skip to main content
Glama
landicefu

Divide and Conquer MCP Server

by landicefu

add_resource

Add resources like files or URLs to tasks to provide context and reference materials for AI agents working on complex problem decomposition.

Instructions

Adds a resource to the task.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the resource
urlYesURL or file path of the resource
descriptionNoDescription of the resource

Implementation Reference

  • The main handler function for the 'add_resource' tool. It validates input, reads current task data, appends the new resource to the resources array, persists the updated data to the config file, and returns success or error response.
    private async addResource(args: any): Promise<any> {
      if (!args?.name || !args?.url) {
        throw new McpError(ErrorCode.InvalidParams, 'Resource name and URL are required');
      }
    
      try {
        const taskData = await this.readTaskData();
        
        // Initialize the resources array if it doesn't exist
        if (!taskData.resources) {
          taskData.resources = [];
        }
        
        // Add the resource
        taskData.resources.push({
          name: args.name,
          url: args.url,
          description: args.description || ''
        });
        
        // Write the updated task data to the file
        await this.writeTaskData(taskData);
        
        return {
          content: [
            {
              type: 'text',
              text: 'Resource added successfully.',
            },
          ],
        };
      } catch (error) {
        console.error('Error adding resource:', error);
        return {
          content: [
            {
              type: 'text',
              text: `Error adding resource: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema defining the parameters for the 'add_resource' tool: name (required string), url (required string), description (optional string).
    inputSchema: {
      type: 'object',
      properties: {
        name: {
          type: 'string',
          description: 'Name of the resource'
        },
        url: {
          type: 'string',
          description: 'URL or file path of the resource'
        },
        description: {
          type: 'string',
          description: 'Description of the resource'
        }
      },
      required: ['name', 'url']
  • src/index.ts:338-359 (registration)
    Registration of the 'add_resource' tool in the ListTools response, including name, description, and input schema.
    {
      name: 'add_resource',
      description: 'Adds a resource to the task.',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Name of the resource'
          },
          url: {
            type: 'string',
            description: 'URL or file path of the resource'
          },
          description: {
            type: 'string',
            description: 'Description of the resource'
          }
        },
        required: ['name', 'url']
      }
    },
  • src/index.ts:444-445 (registration)
    Dispatch/registration in the CallToolRequest handler switch statement that routes 'add_resource' calls to the addResource method.
    case 'add_resource':
      return await this.addResource(request.params.arguments);
  • TypeScript interface defining the structure of a TaskResource, used for resources in task data.
      name: string;
      url: string;
      description?: string;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Adds a resource to the task', implying a write/mutation operation, but doesn't disclose behavioral traits such as required permissions, whether it's idempotent, error handling, or how it affects task state. This leaves significant gaps for a tool that likely modifies data.

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: 'Adds a resource to the task.' It's front-loaded with the core action, has zero waste, and is appropriately sized for a simple tool. Every word earns its place without redundancy.

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 no annotations, no output schema, and a mutation tool with 3 parameters, the description is incomplete. It lacks details on what a 'resource' is, how it integrates with the task, return values, or error cases. For a tool that likely changes state, this minimal description is inadequate for safe and effective 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 100%, with clear descriptions for 'name', 'url', and 'description' parameters. The description adds no meaning beyond the schema, as it doesn't explain parameter relationships, constraints, or usage examples. Baseline is 3 since the schema does the heavy lifting, but no extra value is provided.

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 'Adds a resource to the task' states a clear verb ('Adds') and resource ('resource'), but it's vague about what a 'resource' entails (e.g., file, link, document) and doesn't distinguish it from sibling tools like 'add_note' or 'add_checklist_item', which also add items to tasks. It avoids tautology by not restating the name 'add_resource' directly.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an initialized task), exclusions, or how it differs from similar tools like 'add_note' or 'update_metadata'. The description implies usage for adding resources but offers no context for selection among siblings.

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/landicefu/divide-and-conquer-mcp-server'

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