Support define is tool logic function (#17926)

- supports isTool and timeout settings in defineLogicFunction in apps
and in setting tabs definition
- compute for all toolInputSchema for logic funciton, in settings and in
code steps

<img width="991" height="802" alt="image"
src="https://github.com/user-attachments/assets/05dc1221-cac9-45a3-87b0-3b13161446fd"
/>
This commit is contained in:
martmull
2026-02-16 10:43:29 +01:00
committed by GitHub
parent f694bb99b3
commit da064d5e88
138 changed files with 4839 additions and 367 deletions
@@ -1,5 +1,7 @@
import { Test, type TestingModule } from '@nestjs/testing';
import { DEFAULT_TOOL_INPUT_SCHEMA } from 'twenty-shared/logic-function';
import { MCP_SERVER_METADATA } from 'src/engine/api/mcp/constants/mcp.const';
import { McpCoreController } from 'src/engine/api/mcp/controllers/mcp-core.controller';
import { type JsonRpc } from 'src/engine/api/mcp/dtos/json-rpc';
@@ -152,7 +154,7 @@ describe('McpCoreController', () => {
{
name: 'testTool',
description: 'A test tool',
inputSchema: { type: 'object', properties: {} },
inputSchema: DEFAULT_TOOL_INPUT_SCHEMA,
},
],
},
@@ -3,6 +3,8 @@ import { Test, type TestingModule } from '@nestjs/testing';
import { getRepositoryToken } from '@nestjs/typeorm';
import { jsonSchema } from 'ai';
import { type JSONSchema7 } from 'json-schema';
import { DEFAULT_TOOL_INPUT_SCHEMA } from 'twenty-shared/logic-function';
import { MCP_SERVER_METADATA } from 'src/engine/api/mcp/constants/mcp.const';
import { type JsonRpc } from 'src/engine/api/mcp/dtos/json-rpc';
@@ -264,7 +266,7 @@ describe('McpProtocolService', () => {
const mockTool = {
description: 'Test tool',
inputSchema: jsonSchema({ type: 'object', properties: {} }),
inputSchema: jsonSchema(DEFAULT_TOOL_INPUT_SCHEMA as JSONSchema7),
execute: jest.fn().mockResolvedValue({ result: 'success' }),
};
@@ -319,7 +321,7 @@ describe('McpProtocolService', () => {
const mockTool = {
description: 'Test tool',
inputSchema: jsonSchema({ type: 'object', properties: {} }),
inputSchema: jsonSchema(DEFAULT_TOOL_INPUT_SCHEMA as JSONSchema7),
execute: jest.fn().mockResolvedValue({ result: 'success' }),
};
@@ -375,7 +377,7 @@ describe('McpProtocolService', () => {
const mockToolsMap = {
testTool: {
description: 'Test tool',
inputSchema: jsonSchema({ type: 'object', properties: {} }),
inputSchema: jsonSchema(DEFAULT_TOOL_INPUT_SCHEMA as JSONSchema7),
},
};
@@ -393,7 +395,7 @@ describe('McpProtocolService', () => {
{
name: 'testTool',
description: 'Test tool',
inputSchema: { type: 'object', properties: {} },
inputSchema: DEFAULT_TOOL_INPUT_SCHEMA,
},
],
}),