Skip to main content
Glama
gabeosx

freedcamp

freedcamp_delete_task

Permanently delete tasks from Freedcamp projects. Remove individual or multiple tasks at once with irreversible bulk deletion capabilities.

Instructions

Permanently delete one or more tasks from Freedcamp. WARNING: This action cannot be undone. Supports bulk operations for deleting multiple tasks at once.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tasksYes

Implementation Reference

  • Core function executing the delete logic for a single task: constructs the DELETE API URL and calls executeFreedcampRequest.
    async function processSingleDeleteTask(taskArgs: z.infer<typeof singleDeleteTaskSchema>, authParams: Record<string, string>) {
      try {
        const url = `https://freedcamp.com/api/v1/tasks/${taskArgs.task_id}`;
        const result = await executeFreedcampRequest(url, "DELETE", authParams);
    
        if (result.error) {
          return { type: "text", text: `Error deleting task ID "${taskArgs.task_id}": ${result.error}`, task_id: taskArgs.task_id, details: result.details };
        }
        return { type: "text", text: `Task ID "${taskArgs.task_id}" deleted successfully.`, task_id: taskArgs.task_id, data: result.data };
      } catch (err: any) {
        console.error(`Error processing delete for task ID "${taskArgs.task_id}":`, err);
        return { type: "text", text: `Failed to delete task ID "${taskArgs.task_id}": ${err.message}`, task_id: taskArgs.task_id, error_details: err };
      }
    }
  • Zod input schema definition for a single delete task argument, requiring only 'task_id'.
    const singleDeleteTaskSchema = z.object({
      task_id: z.string().describe("ID of the task to delete (required) - WARNING: This action cannot be undone")
    });
  • Registers the tool with MCP server: defines description, bulk input schema (array of singleDeleteTaskSchema), title annotation, and handler that builds auth and processes each task via processSingleDeleteTask.
    server.registerTool("freedcamp_delete_task",
      {
        description: "Permanently delete one or more tasks from Freedcamp. WARNING: This action cannot be undone. Supports bulk operations for deleting multiple tasks at once.",
        inputSchema: {
          tasks: z.array(singleDeleteTaskSchema)
        },
        annotations: {
          title: "Delete Task"
        }
      },
      async (args) => {
        const tasksToDelete = args.tasks;
        const authParams = buildFreedcampAuthParams({
          api_key: config.apiKey,
          api_secret: config.apiSecret,
        });
    
        const results = await Promise.all(tasksToDelete.map((taskArg: any) => processSingleDeleteTask(taskArg, authParams)));
        return { content: results.map(r => ({ type: "text", text: JSON.stringify(r) })) };
      }
    );
  • Utility function to perform API requests to Freedcamp, handling authentication parameters in FormData or query for DELETE, fetch execution, and response parsing with error handling.
    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 };
    }
  • Builds authentication parameters for Freedcamp API calls, generating timestamp and HMAC hash if api_secret provided.
    export function buildFreedcampAuthParams(auth: FreedcampAuth): Record<string, string> {
      if (auth.api_secret) {
        const timestamp = Math.floor(Date.now() / 1000);
        const hash = generateFreedcampHash(auth.api_key, auth.api_secret, timestamp);
        return {
          api_key: auth.api_key,
          timestamp: String(timestamp),
          hash,
        };
      } else {
        return {
          api_key: auth.api_key,
        };
      }
    } 
Behavior5/5

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

The description adds significant behavioral context beyond what annotations provide. Annotations only give a title ('Delete Task'), while the description explicitly warns that the action 'cannot be undone', clarifies it's permanent, and mentions support for bulk operations - all critical behavioral traits for a destructive operation.

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 perfectly concise with two sentences that each earn their place: the first states the core action with critical warning, the second adds important bulk operation capability. No wasted words, front-loaded with the most critical information.

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

Completeness4/5

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

Given this is a destructive mutation tool with no output schema and minimal annotations, the description does well by warning about irreversibility and mentioning bulk operations. However, it could be more complete by specifying what happens to dependent objects or confirming deletion success criteria.

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?

With 0% schema description coverage (the schema has no parameter descriptions), the description carries the full burden. It adds meaningful context by explaining that the tool supports bulk operations for deleting multiple tasks at once, which helps interpret the 'tasks' array parameter structure, though it doesn't detail individual parameter semantics like 'task_id' format.

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 the specific action ('permanently delete') and resource ('tasks from Freedcamp'), distinguishing it from sibling tools like 'add_task', 'list_tasks', and 'update_task' which perform different operations on the same resource.

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 for when to use this tool ('permanently delete one or more tasks') and mentions bulk operations, but does not explicitly state when NOT to use it or name specific alternatives like 'update_task' for modifications instead of deletions.

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