Skip to main content
Glama
yvanfreitas

MCP Test Server

by yvanfreitas

get_tasks

Retrieve tasks from the mock database by filtering based on status or assigned user ID. Use this tool to manage and organize task data efficiently in the MCP Test Server.

Instructions

Get all tasks from the mock database

Input Schema

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

Implementation Reference

  • TaskService.getAll static method implements the core logic for retrieving all tasks, optionally filtered by status or assignedTo user ID, returning a structured response with success flag, data array, and total count.
    export class TaskService { 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 an object with optional 'status' (string enum) and 'assignedTo' (number) properties for filtering tasks.
    { 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:60-61 (registration)
    In the CallToolRequest handler's switch statement, registers and dispatches 'get_tasks' tool calls by invoking TaskService.getAll with the provided arguments and wrapping in MCP response.
    case 'get_tasks': return createMcpResponse(TaskService.getAll(args));
  • mcp-server.js:40-44 (registration)
    In the ListToolsRequest handler, includes taskToolSchemas (containing 'get_tasks') in the list of available tools, effectively registering the tool for discovery.
    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