Skip to main content
Glama
gabeosx

freedcamp

freedcamp_add_task

Create new tasks in Freedcamp with title, description, priority, due date, and assignee. Supports bulk operations for adding multiple tasks simultaneously.

Instructions

Create one or more new tasks in Freedcamp with support for title, description, priority, due date, and assignee. Supports bulk operations for creating multiple tasks at once.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tasksYes

Implementation Reference

  • The main execution handler for the freedcamp_add_task tool. It extracts the tasks array from args, builds authentication parameters, processes each task using processSingleAddTask in parallel, and formats the results as content blocks.
    async (args) => {
      const tasksToAdd = args.tasks;
      const authParams = buildFreedcampAuthParams({
        api_key: config.apiKey,
        api_secret: config.apiSecret,
      });
    
      const results = await Promise.all(tasksToAdd.map((taskArg: any) => processSingleAddTask(taskArg, authParams, config.projectId)));
      return { content: results.map(r => ({ type: "text", text: JSON.stringify(r) })) };
    }
  • Zod schema defining the structure for a single task input, used within the tool's inputSchema as z.array(singleAddTaskSchema).
    const singleAddTaskSchema = z.object({
      title: z.string().describe("Title of the task (required) - should be clear and descriptive"),
      description: z.string().optional().describe("Detailed description of what the task involves (optional)"),
      due_date: z.string().optional().describe("Due date as Unix timestamp string (optional) - e.g., '1735689600' for 2025-01-01"),
      assigned_to_id: z.string().optional().describe("User ID to assign the task to (optional) - must be valid Freedcamp user ID"),
      priority: z.number().int().min(0).max(3).optional().describe("Task priority level (optional): 0=Low, 1=Normal, 2=High, 3=Urgent")
    });
  • The server.registerTool call that registers the freedcamp_add_task tool, including its description, input schema, annotations, and handler function.
    server.registerTool("freedcamp_add_task",
      {
        description: "Create one or more new tasks in Freedcamp with support for title, description, priority, due date, and assignee. Supports bulk operations for creating multiple tasks at once.",
        inputSchema: {
          tasks: z.array(singleAddTaskSchema)
        },
        annotations: {
          title: "Create Task"
        }
      },
      async (args) => {
        const tasksToAdd = args.tasks;
        const authParams = buildFreedcampAuthParams({
          api_key: config.apiKey,
          api_secret: config.apiSecret,
        });
    
        const results = await Promise.all(tasksToAdd.map((taskArg: any) => processSingleAddTask(taskArg, authParams, config.projectId)));
        return { content: results.map(r => ({ type: "text", text: JSON.stringify(r) })) };
      }
    );
  • Core helper function that implements the logic for adding a single task: constructs the request data, invokes the Freedcamp API via executeFreedcampRequest, processes the response, and returns formatted result or error.
    async function processSingleAddTask(taskArgs: z.infer<typeof singleAddTaskSchema>, authParams: Record<string, string>, projectId: string) {
      try {
        const data: Record<string, any> = {
          project_id: projectId,
          title: taskArgs.title,
        };
        if (taskArgs.description) data.description = taskArgs.description;
        if (taskArgs.due_date) data.due_date = taskArgs.due_date;
        if (taskArgs.assigned_to_id) data.assigned_to_id = taskArgs.assigned_to_id;
        if (typeof taskArgs.priority === "number") data.priority = taskArgs.priority;
    
        const result = await executeFreedcampRequest("https://freedcamp.com/api/v1/tasks", "POST", authParams, data);
    
        if (result.error) {
          return { type: "text", text: `Error adding task "${taskArgs.title}": ${result.error}`, details: result.details };
        }
        const taskId = result.data?.tasks?.[0]?.id;
        return { type: "text", text: `Task "${taskArgs.title}" created with ID: ${taskId}`, task_id: taskId };
      } catch (err: any) {
        console.error(`Error processing add task "${taskArgs.title}":`, err);
        return { type: "text", text: `Failed to add task "${taskArgs.title}": ${err.message}`, error_details: err };
      }
    }
  • Shared utility function for making authenticated HTTP requests to the Freedcamp API using FormData for POST/PUT/DELETE operations.
    async function executeFreedcampRequest(url: string, method: string, authParams: Record<string, string>, bodyData?: Record<string, any>) {
      const form = new FormData();
      if (bodyData) {
        form.append("data", JSON.stringify(bodyData));
      }
      for (const [k, v] of Object.entries(authParams)) {
        form.append(k, v);
      }
    
      let requestUrl = url;
      let requestBody: any = form;
      if (method === "DELETE" && !bodyData) {
        const params = new URLSearchParams(authParams);
        requestUrl = `${url}?${params.toString()}`;
        requestBody = undefined;
      }
    
      console.log(`Making ${method} request to Freedcamp API: ${requestUrl}`);
    
      const resp = await fetch(requestUrl, {
        method: method,
        body: requestBody,
      });
      const json = (await resp.json()) as any;
      console.log("Freedcamp API response:", json);
    
      if (!resp.ok || (json && json.http_code >= 400)) {
        return { error: json?.msg || resp.statusText, details: json };
      }
      return { success: true, data: json?.data };
    }
Behavior3/5

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

Annotations only provide a title ('Create Task'), so the description carries the burden. It discloses that the tool creates tasks and supports bulk operations, which is useful context beyond annotations. However, it lacks details on permissions, rate limits, or what happens on failure, which are important for a creation tool with no output schema.

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 two sentences, front-loaded with the main purpose and followed by key features. Every sentence adds value: the first defines the action and scope, the second highlights bulk capability and supported fields, with no wasted words.

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 no output schema and annotations only providing a title, the description is somewhat complete for a creation tool but lacks details on return values, error handling, or prerequisites. It covers the basics but could be more informative for a tool with 1 parameter (an array of objects) and no structured output documentation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/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 lists supported fields (title, description, priority, due date, assignee) and mentions bulk operations, adding meaning beyond the schema's structure. However, it does not explain the 'tasks' array parameter's semantics or constraints in detail.

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

Purpose5/5

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

The description clearly states 'Create one or more new tasks in Freedcamp' with specific verb (create) and resource (tasks), and distinguishes from siblings by focusing on creation rather than deletion, listing, or updating mentioned in sibling tool names.

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 implies usage for creating tasks and mentions 'bulk operations for creating multiple tasks at once,' which provides context for when to use it (multiple tasks). However, it does not explicitly state when not to use it or name alternatives like the sibling tools for other operations.

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/gabeosx/freedmcpcamp'

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