poker_proposeUnit
Propose default unit settings for length, angle, density, and radioactivity when missing from YAML configuration files to ensure complete unit specification.
Instructions
単位設定セクションを提案します(YAMLファイルに未存在の場合のみ)- 4キー完全性保証
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| angle | Yes | 角度の単位 | radian |
| density | Yes | 密度の単位 | g/cm3 |
| length | Yes | 長さの単位 | cm |
| radioactivity | Yes | 放射能の単位 | Bq |
Implementation Reference
- src/mcp/handlers/unitHandlers.js:100-144 (handler)MCP tool handler function that implements the core logic for 'poker_proposeUnit', delegating to taskManager.proposeUnit while handling errors and logging.async proposeUnit(args) { try { const { length, angle, density, radioactivity } = args; logger.info('4キー完全単位設定提案開始', { length, angle, density, radioactivity }); // TaskManagerの4キー完全性保証機能を利用 const result = await taskManager.proposeUnit(length, angle, density, radioactivity); logger.info('4キー完全単位設定提案完了', { units: { length, angle, density, radioactivity } }); return { success: true, message: result, unit: { length, angle, density, radioactivity, integrity: '4-key-complete' } }; } catch (error) { logger.error('単位設定提案エラー', { args, error: error.message }); // マニフェスト仕様のpropose専用エラーコード処理 if (error.code === -32086) { return { success: false, error: error.message, details: { errorCode: error.code, suggestion: 'updateUnitメソッドを使用してください', existingObject: 'unit', objectType: '単位設定' } }; } throw error; } },
- src/mcp/tools/unitTools.js:3-38 (schema)Input schema and metadata definition for the 'poker_proposeUnit' tool.{ name: 'poker_proposeUnit', description: '単位設定セクションを提案します(YAMLファイルに未存在の場合のみ)- 4キー完全性保証', inputSchema: { type: 'object', properties: { length: { type: 'string', enum: ['m', 'cm', 'mm'], description: '長さの単位', default: 'cm' }, angle: { type: 'string', enum: ['radian', 'degree'], description: '角度の単位', default: 'radian' }, density: { type: 'string', enum: ['g/cm3'], description: '密度の単位', default: 'g/cm3' }, radioactivity: { type: 'string', enum: ['Bq'], description: '放射能の単位', default: 'Bq' } }, required: ['length', 'angle', 'density', 'radioactivity'], additionalProperties: false, title: '4キー必須単位構造', description: '全4キー(length, angle, density, radioactivity)が必須です。部分指定は不可。' }
- src/mcp/server.js:43-57 (registration)Dynamic registration of the CallToolRequestHandler that maps 'poker_proposeUnit' to the 'proposeUnit' handler function via name replacement.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 })(); });