Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
refactor(mcp): drop the unused tool result disposition
Yudhi Armyndharis6d84cca43cf3
diff --git a/src/core/agent-tools/tool-descriptor.ts b/src/core/agent-tools/tool-descriptor.tsindex 5b77d9410..5cbe3b136 100644--- a/src/core/agent-tools/tool-descriptor.ts+++ b/src/core/agent-tools/tool-descriptor.ts@@ -24,8 +24,6 @@ export interface ToolDescriptor<I = unknown> {chatScope?: readonly string[] | 'filtered' | 'agnostic';/** The quote resolves within the authorized chat, as it does on the REST reply route. */chatQuotedAllowed?: boolean;- /** Result rendering hint for the MCP adapter. Default 'smart'. */- resultDisposition?: 'json' | 'smart';/** Calls the service. Receives validated input + the resolved, scoped key. */handler: (input: I, apiKey: ApiKey, chatScope?: ChatScopeService) => Promise<unknown>;}diff --git a/src/modules/mcp/mcp.server.ts b/src/modules/mcp/mcp.server.tsindex 128090300..01810685c 100644--- a/src/modules/mcp/mcp.server.ts+++ b/src/modules/mcp/mcp.server.ts@@ -15,7 +15,7 @@ import { UnresolvedApiKeyException, type AuthService } from '../auth/auth.servicimport { allowUnauthenticatedAuditRow } from '../audit/auth-failure-audit-limiter';import type { AuditService } from '../audit/audit.service';import { AuditAction } from '../audit/entities/audit-log.entity';-import { handleToolError, jsonToolResult, smartToolResult } from './tool-result';+import { handleToolError, smartToolResult } from './tool-result';import type { KeyRateLimiter } from './mcp-rate-limit';import { limiterKeyForIp, parseTrustedProxies, resolveClientIp } from '../../common/utils/ip';import { resolveBodyLimit } from '../../config/bootstrap-security';@@ -136,9 +136,7 @@ function buildServer(error => auditMcpAuthFailure(auditService, error, reqContext),chatScope,);- return tool.resultDisposition === 'json'- ? jsonToolResult(result as object)- : smartToolResult(result as object);+ return smartToolResult(result as object);} catch (error) {return handleToolError(error);}