Files
ulthon_admin/extend/base/mcp/service/McpDispatchBase.php

32 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
declare(strict_types=1);
namespace base\mcp\service;
/**
* MCP 工具分发器T8 实现真实分发).
*
* 职责T8以 McpService::verifyNode 还原编码工具名 -> 校验权限 ->
* 内部 HTTP 调用对应节点 -> McpService::logCall 审计。
*
* T7 仅提供空壳占位,保证 tools/list 与 tools/call 链路可用:
* call 返回固定错误文案,由 ToolResultFormatter 包装为 TextContent。
*/
class McpDispatchBase
{
/**
* 分发一次 MCP 工具调用.
*
* @param array $auth McpService::authenticate() 的返回结构key_row + creator
* @param string $toolName MCP 编码工具名(如 system-quick--index需 verifyNode 还原)
* @param array $arguments 客户端原始参数(已剔除 _session/_request 内部键)
* @return string 工具执行结果(文本)
*/
public function call(array $auth, string $toolName, array $arguments): string
{
// T8 实现真实分发逻辑
return '[ERROR] 分发器未就绪T8 实现)';
}
}