feat(mcp) - optimize instruction prompt and hide get_tool_catalog (#21183)
Workspace-aware initialize.instructions - Deleted the static mcp-server-instructions.const.ts - Created build-mcp-server-instructions.util.ts — a comprehensive system prompt with identity, object list, tool grammar, routing decision tree, intent mapping, skills vs tools, safety constraints, and data efficiency guidelines - Created McpInstructionBuilderService — fetches workspace-specific object names + skill names and injects them into the instructions Hide/deprecate get_tool_catalog Benefit : skip first MCP call (tools are included in instruction)
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
import { isWorkflowRelatedObject } from 'src/engine/metadata-modules/ai/ai-agent/utils/is-workflow-related-object.util';
|
||||
|
||||
type FlatObjectWithActivityAndIdentifier = {
|
||||
isActive: boolean;
|
||||
universalIdentifier: string;
|
||||
};
|
||||
|
||||
export const getDatabaseCrudToolFlatObjects = <
|
||||
T extends FlatObjectWithActivityAndIdentifier,
|
||||
>(
|
||||
byUniversalIdentifier: Partial<Record<string, T>>,
|
||||
): T[] => {
|
||||
return Object.values(byUniversalIdentifier)
|
||||
.filter(isDefined)
|
||||
.filter((obj) => obj.isActive && !isWorkflowRelatedObject(obj));
|
||||
};
|
||||
Reference in New Issue
Block a user