Skip to main content
Glama
yvanfreitas

MCP Test Server

by yvanfreitas

update_task

Modify existing task details including title, status, and assigned user to manage workflow changes effectively.

Instructions

Update an existing task

Input Schema

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

Implementation Reference

  • Input schema and description for the 'update_task' tool, defining parameters like id (required), title, status, 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'] } }
  • mcp-server.js:38-46 (registration)
    Tool list registration handler that includes 'update_task' schema by spreading taskToolSchemas into the list of available tools.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ ...userToolSchemas, ...taskToolSchemas, searchToolSchema ] }; });
  • TaskService.update static method implements the business logic for updating a task by ID in the mock data store, handling partial updates.
    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 }; }

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