freedcamp_list_tasks
Retrieve all tasks from a Freedcamp project with details including status, priority, due dates, and assignee information.
Instructions
Retrieve all tasks in the configured Freedcamp project. Returns task details including ID, title, description, status, priority, due date, and assignee information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcpServer.ts:209-239 (handler)The handler function that executes the freedcamp_list_tasks tool. It builds auth params, constructs the API URL for the project tasks, fetches the data, and returns the tasks as formatted JSON or an error message.async () => { const authParams = buildFreedcampAuthParams({ api_key: config.apiKey, api_secret: config.apiSecret, }); const params = new URLSearchParams({ ...authParams, project_id: config.projectId, }); const url = `https://freedcamp.com/api/v1/tasks/?${params.toString()}`; console.log("Making request to Freedcamp API with URL:", url); const resp = await fetch(url, { method: "GET", }); const json = (await resp.json()) as any; console.log("Freedcamp API response:", json); if (!resp.ok || (json && json.http_code >= 400)) { return { content: [ { type: "text", text: `Error: ${json?.msg || resp.statusText}` }, { type: "text", text: JSON.stringify(json) } ] }; } return { content: [ { type: "text", text: JSON.stringify(json?.data?.tasks || [], null, 2) }, ] }; }
- src/mcpServer.ts:202-208 (schema)The input schema and metadata (description, annotations) for the freedcamp_list_tasks tool. Note: inputSchema is empty as no parameters are required.{ description: "Retrieve all tasks in the configured Freedcamp project. Returns task details including ID, title, description, status, priority, due date, and assignee information.", inputSchema: {}, annotations: { title: "List Tasks" } },
- src/mcpServer.ts:201-240 (registration)The server.registerTool call that registers the freedcamp_list_tasks tool, including schema and inline handler function.server.registerTool("freedcamp_list_tasks", { description: "Retrieve all tasks in the configured Freedcamp project. Returns task details including ID, title, description, status, priority, due date, and assignee information.", inputSchema: {}, annotations: { title: "List Tasks" } }, async () => { const authParams = buildFreedcampAuthParams({ api_key: config.apiKey, api_secret: config.apiSecret, }); const params = new URLSearchParams({ ...authParams, project_id: config.projectId, }); const url = `https://freedcamp.com/api/v1/tasks/?${params.toString()}`; console.log("Making request to Freedcamp API with URL:", url); const resp = await fetch(url, { method: "GET", }); const json = (await resp.json()) as any; console.log("Freedcamp API response:", json); if (!resp.ok || (json && json.http_code >= 400)) { return { content: [ { type: "text", text: `Error: ${json?.msg || resp.statusText}` }, { type: "text", text: JSON.stringify(json) } ] }; } return { content: [ { type: "text", text: JSON.stringify(json?.data?.tasks || [], null, 2) }, ] }; } );
- src/freedcamp.ts:26-39 (helper)Helper function buildFreedcampAuthParams used in the handler to generate authentication parameters (api_key, timestamp, hash for secured API) for the Freedcamp API request.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, }; }