Skip to content

The open alternative to Salesforce, designed for AI.

690 B
Raw Blame
import { MCP_DATABASE_CRUD_TOOL_ANNOTATIONS } from 'src/engine/api/mcp/constants/mcp-database-crud-tool-annotations.constant';
import { MCP_EXECUTE_TOOL_ANNOTATIONS } from 'src/engine/api/mcp/constants/mcp-execute-tool-annotations.const';
import { type McpToolAnnotations } from 'src/engine/api/mcp/types/mcp-tool-annotations.type';
import { type ToolExecutionRef } from 'src/engine/core-modules/tool-provider/types/tool-execution-ref.type';

export const getMcpRegistryToolAnnotations = (
  executionRef: ToolExecutionRef,
): McpToolAnnotations =>
  executionRef.kind === 'database_crud'
    ? MCP_DATABASE_CRUD_TOOL_ANNOTATIONS[executionRef.operation]
    : MCP_EXECUTE_TOOL_ANNOTATIONS;