Skip to main content
Glama
yvanfreitas

MCP Test Server

by yvanfreitas

get_tasks

Retrieve and filter tasks from a database by status or assigned user to manage workflow and track progress.

Instructions

Get all tasks from the mock database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNoFilter tasks by status
assignedToNoFilter tasks by assigned user ID

Implementation Reference

  • Executes the get_tasks tool logic by filtering tasks based on optional status and assignedTo parameters from mock data.
    static getAll(filters = {}) { let filteredTasks = tasks; if (filters.status) { filteredTasks = filteredTasks.filter(task => task.status === filters.status); } if (filters.assignedTo) { filteredTasks = filteredTasks.filter(task => task.assignedTo === filters.assignedTo); } return { success: true, data: filteredTasks, total: filteredTasks.length }; }
  • Defines the input schema for the get_tasks tool, specifying optional filters for status (enum) and assignedTo (number).
    { name: 'get_tasks', description: 'Get all tasks from the mock database', inputSchema: { type: 'object', properties: { status: { type: 'string', description: 'Filter tasks by status', enum: ['pending', 'in-progress', 'completed'] }, assignedTo: { type: 'number', description: 'Filter tasks by assigned user ID' } } } },
  • mcp-server.js:38-46 (registration)
    Registers the get_tasks tool schema by including taskToolSchemas in the response to ListToolsRequest.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ ...userToolSchemas, ...taskToolSchemas, searchToolSchema ] }; });
  • mcp-server.js:60-61 (registration)
    Handles incoming calls to the get_tasks tool by dispatching to TaskService.getAll with the provided arguments.
    case 'get_tasks': return createMcpResponse(TaskService.getAll(args));

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