Skip to main content
Glama
yvanfreitas

MCP Test Server

by yvanfreitas

get_task

Retrieve a specific task by its unique ID to access task details and information within the MCP Test Server system.

Instructions

Get a specific task by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesTask ID

Implementation Reference

  • TaskService.getById implements the logic to retrieve a specific task by ID, matching the 'get_task' tool's purpose.
    static getById(id) {
      const task = tasks.find(t => t.id === id);
      
      if (!task) {
        return {
          success: false,
          message: 'Task not found'
        };
      }
    
      return {
        success: true,
        data: task
      };
    }
  • Defines the input schema for the 'get_task' tool, specifying required 'id' parameter.
    {
      name: 'get_task',
      description: 'Get a specific task by ID',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'number',
            description: 'Task ID'
          }
        },
        required: ['id']
      }
    },
  • mcp-server.js:39-47 (registration)
    Registers the list of available tools, including taskToolSchemas which contains the 'get_task' schema.
      return {
        tools: [
          ...userToolSchemas,
          ...taskToolSchemas,
          searchToolSchema
        ]
      };
    });

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