Skip to main content
Glama
yvanfreitas

MCP Test Server

by yvanfreitas

update_task

Modify task details such as title, status, or assigned user on the MCP Test Server. Requires task ID to update and supports fields like status and user assignment.

Instructions

Update an existing task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assignedToNoID of user assigned to this task
idYesTask ID
statusNoTask status
titleNoTask title

Implementation Reference

  • Input schema definition for the 'update_task' tool, specifying parameters like id (required), title, status, and assignedTo.
    { name: 'update_task', description: 'Update an existing task', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Task ID' }, title: { type: 'string', description: 'Task title' }, status: { type: 'string', description: 'Task status', enum: ['pending', 'in-progress', 'completed'] }, assignedTo: { type: 'number', description: 'ID of user assigned to this task' } }, required: ['id'] } }
  • TaskService.update method provides the core logic to update a task by ID in the mock data store, handling partial updates for title, status, and assignedTo.
    static update(id, taskData) { const taskIndex = tasks.findIndex(t => t.id === id); if (taskIndex === -1) { return { success: false, message: 'Task not found' }; } const { title, status, assignedTo } = taskData; const updatedTask = { ...tasks[taskIndex] }; if (title) updatedTask.title = title; if (status) updatedTask.status = status; if (assignedTo !== undefined) updatedTask.assignedTo = assignedTo ? parseInt(assignedTo) : null; tasks[taskIndex] = updatedTask; return { success: true, message: 'Task updated successfully', data: updatedTask }; }
  • mcp-server.js:38-46 (registration)
    Tool registration via the ListToolsRequestHandler, which includes taskToolSchemas containing 'update_task' in the list of available tools.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ ...userToolSchemas, ...taskToolSchemas, searchToolSchema ] }; });

Other Tools

Related 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/yvanfreitas/MCP-test'

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