Skip to main content
Glama

freedcamp_update_task

Modify existing Freedcamp tasks by updating title, description, priority, due date, assignee, or status. Supports bulk operations for multiple tasks.

Instructions

Update one or more existing tasks in Freedcamp including title, description, priority, due date, assignee, and status. Supports bulk operations for updating multiple tasks at once.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tasksYes

Implementation Reference

  • The main tool handler function that processes a list of tasks to update, builds authentication parameters, calls the single task update helper for each, and returns formatted text results.
    async (args) => { const tasksToUpdate = args.tasks; const authParams = buildFreedcampAuthParams({ api_key: config.apiKey, api_secret: config.apiSecret, }); const results = await Promise.all(tasksToUpdate.map((taskArg: any) => processSingleUpdateTask(taskArg, authParams))); return { content: results.map(r => ({ type: "text", text: JSON.stringify(r) })) }; }
  • Zod schema defining the input parameters for updating a single task. Referenced in the tool's inputSchema as an array for bulk support.
    const singleUpdateTaskSchema = z.object({ task_id: z.string().describe("ID of the task to update (required) - must be valid existing Freedcamp task ID"), title: z.string().optional().describe("New task title (optional)"), description: z.string().optional().describe("New task description (optional)"), due_date: z.string().optional().describe("New due date as Unix timestamp string (optional) - e.g., '1735689600' for 2025-01-01"), assigned_to_id: z.string().optional().describe("User ID to reassign the task to (optional) - must be valid Freedcamp user ID"), priority: z.number().int().min(0).max(3).optional().describe("New task priority level (optional): 0=Low, 1=Normal, 2=High, 3=Urgent"), status: z.number().int().min(0).max(2).optional().describe("New task status (optional): 0=Open, 1=Completed, 2=Closed") });
  • Registration of the freedcamp_update_task tool in the MCP server, including description, input schema (bulk array), annotations, and handler function.
    server.registerTool("freedcamp_update_task", { description: "Update one or more existing tasks in Freedcamp including title, description, priority, due date, assignee, and status. Supports bulk operations for updating multiple tasks at once.", inputSchema: { tasks: z.array(singleUpdateTaskSchema) }, annotations: { title: "Update Task" } }, async (args) => { const tasksToUpdate = args.tasks; const authParams = buildFreedcampAuthParams({ api_key: config.apiKey, api_secret: config.apiSecret, }); const results = await Promise.all(tasksToUpdate.map((taskArg: any) => processSingleUpdateTask(taskArg, authParams))); return { content: results.map(r => ({ type: "text", text: JSON.stringify(r) })) }; } );
  • Helper function that handles updating a single task: prepares data payload from args, makes POST request to Freedcamp edit endpoint, handles success/error responses.
    async function processSingleUpdateTask(taskArgs: z.infer<typeof singleUpdateTaskSchema>, authParams: Record<string, string>) { try { const data: Record<string, any> = {}; if (taskArgs.title) data.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; if (typeof taskArgs.status === "number") data.status = taskArgs.status; const url = `https://freedcamp.com/api/v1/tasks/${taskArgs.task_id}/edit`; const result = await executeFreedcampRequest(url, "POST", authParams, data); if (result.error) { return { type: "text", text: `Error updating task ID "${taskArgs.task_id}": ${result.error}`, task_id: taskArgs.task_id, details: result.details }; } return { type: "text", text: `Task ID "${taskArgs.task_id}" updated.`, task_id: taskArgs.task_id, data: result.data }; } catch (err: any) { console.error(`Error processing update for task ID "${taskArgs.task_id}":`, err); return { type: "text", text: `Failed to update task ID "${taskArgs.task_id}": ${err.message}`, task_id: taskArgs.task_id, error_details: err }; } }
  • Utility function to execute HTTP requests to Freedcamp API using FormData for auth and body, handles DELETE specially, parses responses and errors.
    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 }; }

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