Skip to main content
Glama
Hirao-Y

Poker Task Management MCP

by Hirao-Y

poker_deleteSource

Remove radiation sources from task management systems by specifying the source name to delete unwanted or obsolete radioactive materials.

Instructions

放射線源を削除します

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes削除対象線源名

Implementation Reference

  • The handler function for poker_deleteSource (mapped as deleteSource). Validates input and calls taskManager.deleteSource.
    async deleteSource(args) {
      try {
        validateDeleteSourceRequest(args);
        const result = await taskManager.deleteSource(args.name);
        return { success: true, message: result };
      } catch (error) {
        logger.error('deleteSourceハンドラーエラー', { args, error: error.message });
        throw error;
      }
    }
  • The MCP tool schema definition for poker_deleteSource, including input validation schema.
    {
      name: 'poker_deleteSource',
      description: '放射線源を削除します',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: '削除対象線源名'
          }
        },
        required: ['name']
      }
    }
  • Registration of the tools/call handler in MCP server, which dispatches 'poker_deleteSource' to deleteSource handler by stripping 'poker_' prefix.
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
      
      logger.info(`MCP Tool実行: ${name}`, { args });
      
      // ハンドラー名をツール名から生成(プレフィックス除去)
      const handlerName = name.replace('poker_', '');
      
      const handler = this.handlers[handlerName];
      if (!handler) {
        throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
      }
      
      return await safeExecute(async () => handler(args), { tool: name })();
    });
  • The createSourceHandlers function that defines and returns the deleteSource handler as part of source tools handlers object.
    export function createSourceHandlers(taskManager) {
      return {
        async proposeSource(args) {
          try {
            validateSourceRequest(args);
            const result = await taskManager.proposeSource(args);
            return { success: true, message: result };
          } catch (error) {
            logger.error('proposeSourceハンドラーエラー', { args, error: error.message });
            
            // マニフェスト仕様のpropose専用エラーコード処理
            if (error.code === -32078) {
              return {
                success: false,
                error: error.message,
                details: {
                  errorCode: error.code,
                  suggestion: 'updateSourceメソッドを使用してください',
                  existingObject: args.name,
                  objectType: '線源'
                }
              };
            }
            
            throw error;
          }
        },
        
        async updateSource(args) {
          try {
            validateUpdateSourceRequest(args);
            const { name, ...updates } = args;
            const result = await taskManager.updateSource(name, updates);
            return { success: true, message: result };
          } catch (error) {
            logger.error('updateSourceハンドラーエラー', { args, error: error.message });
            
            // マニフェスト仕様のupdate専用エラーコード処理
            if (error.code === -32079) {
              return {
                success: false,
                error: error.message,
                details: {
                  errorCode: error.code,
                  suggestion: 'proposeSourceメソッドを使用してください',
                  missingObject: args.name,
                  objectType: '線源'
                }
              };
            }
            
            throw error;
          }
        },
        
        async deleteSource(args) {
          try {
            validateDeleteSourceRequest(args);
            const result = await taskManager.deleteSource(args.name);
            return { success: true, message: result };
          } catch (error) {
            logger.error('deleteSourceハンドラーエラー', { args, error: error.message });
            throw error;
          }
        }
      };
    }

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/Hirao-Y/poker_mcp'

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