toolsRegistry.tsâĸ9.34 kB
import { TOOL_DEFINITION as GetProgram_Tool } from '../handlers/handleGetProgram';
import { TOOL_DEFINITION as GetClass_Tool } from '../handlers/handleGetClass';
import { TOOL_DEFINITION as GetFunction_Tool } from '../handlers/handleGetFunction';
import { TOOL_DEFINITION as GetFunctionGroup_Tool } from '../handlers/handleGetFunctionGroup';
import { TOOL_DEFINITION as GetTable_Tool } from '../handlers/handleGetTable';
import { TOOL_DEFINITION as GetStructure_Tool } from '../handlers/handleGetStructure';
import { TOOL_DEFINITION as GetTableContents_Tool } from '../handlers/handleGetTableContents';
import { TOOL_DEFINITION as GetPackage_Tool } from '../handlers/handleGetPackage';
import { TOOL_DEFINITION as CreatePackage_Tool } from '../handlers/handleCreatePackage';
import { TOOL_DEFINITION as GetInclude_Tool } from '../handlers/handleGetInclude';
import { TOOL_DEFINITION as GetIncludesList_Tool } from '../handlers/handleGetIncludesList';
import { TOOL_DEFINITION as GetTypeInfo_Tool } from '../handlers/handleGetTypeInfo';
import { TOOL_DEFINITION as GetInterface_Tool } from '../handlers/handleGetInterface';
import { TOOL_DEFINITION as GetTransaction_Tool } from '../handlers/handleGetTransaction';
import { TOOL_DEFINITION as SearchObject_Tool } from '../handlers/handleSearchObject';
import { TOOL_DEFINITION as GetEnhancements_Tool } from '../handlers/handleGetEnhancements';
import { TOOL_DEFINITION as GetEnhancementImpl_Tool } from '../handlers/handleGetEnhancementImpl';
import { TOOL_DEFINITION as GetEnhancementSpot_Tool } from '../handlers/handleGetEnhancementSpot';
import { TOOL_DEFINITION as GetBdef_Tool } from '../handlers/handleGetBdef';
import { TOOL_DEFINITION as GetSqlQuery_Tool } from '../handlers/handleGetSqlQuery';
import { TOOL_DEFINITION as GetWhereUsed_Tool } from '../handlers/handleGetWhereUsed';
import { TOOL_DEFINITION as GetObjectInfo_Tool } from '../handlers/handleGetObjectInfo';
import { TOOL_DEFINITION as DescribeByList_Tool } from '../handlers/handleDescribeByList';
import { TOOL_DEFINITION as GetObjectsByType_Tool } from '../handlers/handleGetObjectsByType';
import { TOOL_DEFINITION as GetObjectsList_Tool } from '../handlers/handleGetObjectsList';
import { TOOL_DEFINITION as GetProgFullCode_Tool } from '../handlers/handleGetProgFullCode';
import { TOOL_DEFINITION as GetObjectNodeFromCache_Tool } from '../handlers/handleGetObjectNodeFromCache';
import { TOOL_DEFINITION as GetAdtTypes_Tool } from '../handlers/handleGetAllTypes';
import { TOOL_DEFINITION as GetObjectStructure_Tool } from '../handlers/handleGetObjectStructure';
import { TOOL_DEFINITION as GetAbapAST_Tool } from '../handlers/handleGetAbapAST';
import { TOOL_DEFINITION as GetAbapSemanticAnalysis_Tool } from '../handlers/handleGetAbapSemanticAnalysis';
import { TOOL_DEFINITION as GetAbapSystemSymbols_Tool } from '../handlers/handleGetAbapSystemSymbols';
import { TOOL_DEFINITION as GetDomain_Tool } from '../handlers/handleGetDomain';
import { TOOL_DEFINITION as CreateDomain_Tool } from '../handlers/handleCreateDomain';
import { TOOL_DEFINITION as UpdateDomain_Tool } from '../handlers/handleUpdateDomain';
import { TOOL_DEFINITION as CreateDataElement_Tool } from '../handlers/handleCreateDataElement';
import { TOOL_DEFINITION as UpdateDataElement_Tool } from '../handlers/handleUpdateDataElement';
import { TOOL_DEFINITION as GetDataElement_Tool } from '../handlers/handleGetDataElement';
import { TOOL_DEFINITION as CreateTransport_Tool } from '../handlers/handleCreateTransport';
import { TOOL_DEFINITION as GetTransport_Tool } from '../handlers/handleGetTransport';
import { TOOL_DEFINITION as CreateTable_Tool } from '../handlers/handleCreateTable';
import { TOOL_DEFINITION as CreateStructure_Tool } from '../handlers/handleCreateStructure';
import { TOOL_DEFINITION as CreateView_Tool } from '../handlers/handleCreateView';
import { TOOL_DEFINITION as GetView_Tool } from '../handlers/handleGetView';
import { TOOL_DEFINITION as CreateClass_Tool } from '../handlers/handleCreateClass';
import { TOOL_DEFINITION as CreateProgram_Tool } from '../handlers/handleCreateProgram';
import { TOOL_DEFINITION as CreateInterface_Tool } from '../handlers/handleCreateInterface';
import { TOOL_DEFINITION as CreateFunctionGroup_Tool } from '../handlers/handleCreateFunctionGroup';
import { TOOL_DEFINITION as CreateFunctionModule_Tool } from '../handlers/handleCreateFunctionModule';
import { TOOL_DEFINITION as ActivateObject_Tool } from '../handlers/handleActivateObject';
import { TOOL_DEFINITION as DeleteObject_Tool } from '../handlers/handleDeleteObject';
import { TOOL_DEFINITION as CheckObject_Tool } from '../handlers/handleCheckObject';
import { TOOL_DEFINITION as UpdateClassSource_Tool } from '../handlers/handleUpdateClassSource';
import { TOOL_DEFINITION as UpdateProgramSource_Tool } from '../handlers/handleUpdateProgramSource';
import { TOOL_DEFINITION as UpdateViewSource_Tool } from '../handlers/handleUpdateViewSource';
import { TOOL_DEFINITION as UpdateInterfaceSource_Tool } from '../handlers/handleUpdateInterfaceSource';
import { TOOL_DEFINITION as UpdateFunctionModuleSource_Tool } from '../handlers/handleUpdateFunctionModuleSource';
import { TOOL_DEFINITION as GetSession_Tool } from '../handlers/handleGetSession';
import { TOOL_DEFINITION as ValidateObject_Tool } from '../handlers/handleValidateObject';
import { TOOL_DEFINITION as LockObject_Tool } from '../handlers/handleLockObject';
import { TOOL_DEFINITION as UnlockObject_Tool } from '../handlers/handleUnlockObject';
import { TOOL_DEFINITION as ValidateClass_Tool } from '../handlers/handleValidateClass';
import { TOOL_DEFINITION as CheckClass_Tool } from '../handlers/handleCheckClass';
import { TOOL_DEFINITION as ValidateTable_Tool } from '../handlers/handleValidateTable';
import { TOOL_DEFINITION as CheckTable_Tool } from '../handlers/handleCheckTable';
import { TOOL_DEFINITION as ValidateFunctionModule_Tool } from '../handlers/handleValidateFunctionModule';
import { TOOL_DEFINITION as CheckFunctionModule_Tool } from '../handlers/handleCheckFunctionModule';
// Type that describes a tool entry
// Supports both JSON Schema format and Zod schema format (object with Zod fields)
export interface ToolDefinition {
name: string;
description: string;
inputSchema:
| {
// JSON Schema format
type: string;
properties: Record<string, any>;
required: readonly string[];
}
| Record<string, any>; // Zod schema format (object with Zod fields)
}
// Static descriptors for tools that rely on dynamic import
const DYNAMIC_IMPORT_TOOLS: ToolDefinition[] = [
GetObjectsByType_Tool,
GetObjectsList_Tool,
GetProgFullCode_Tool,
GetObjectNodeFromCache_Tool,
DescribeByList_Tool
];
// Aggregate every tool definition into a single list
export const ALL_TOOLS: ToolDefinition[] = [
// Programs, classes, functions
GetClass_Tool,
GetFunction_Tool,
GetFunctionGroup_Tool,
GetProgram_Tool,
// Tables, structures
GetStructure_Tool,
GetTable_Tool,
GetTableContents_Tool,
// Packages, interfaces
GetInterface_Tool,
GetPackage_Tool,
CreatePackage_Tool,
// Includes, hierarchies
GetInclude_Tool,
GetIncludesList_Tool,
GetObjectStructure_Tool,
// Types, descriptions, metadata
GetAdtTypes_Tool,
GetTypeInfo_Tool,
GetObjectInfo_Tool,
// Search, SQL, transactions
GetSqlQuery_Tool,
GetTransaction_Tool,
SearchObject_Tool,
GetWhereUsed_Tool,
// Enhancement
GetBdef_Tool,
GetEnhancementImpl_Tool,
GetEnhancements_Tool,
GetEnhancementSpot_Tool,
// ABAP Parser & Semantic Analysis
GetAbapAST_Tool,
GetAbapSemanticAnalysis_Tool,
GetAbapSystemSymbols_Tool,
// Domain management
GetDomain_Tool,
CreateDomain_Tool,
UpdateDomain_Tool,
// Data Element management
GetDataElement_Tool,
CreateDataElement_Tool,
UpdateDataElement_Tool,
// Transport management
GetTransport_Tool,
CreateTransport_Tool,
// Table and Structure management
CreateTable_Tool,
CreateStructure_Tool,
// Class management
CreateClass_Tool,
UpdateClassSource_Tool,
// Program management
CreateProgram_Tool,
UpdateProgramSource_Tool,
// Interface management
CreateInterface_Tool,
UpdateInterfaceSource_Tool,
// Function Group management
CreateFunctionGroup_Tool,
// Function Module management
CreateFunctionModule_Tool,
UpdateFunctionModuleSource_Tool,
// View management
CreateView_Tool,
GetView_Tool,
UpdateViewSource_Tool,
// Activation
ActivateObject_Tool,
// Deletion
DeleteObject_Tool,
// Syntax check
CheckObject_Tool,
// Session and lock management
GetSession_Tool,
ValidateObject_Tool,
LockObject_Tool,
UnlockObject_Tool,
// Class-specific validation and checking
ValidateClass_Tool,
CheckClass_Tool,
// Table-specific validation and checking
ValidateTable_Tool,
CheckTable_Tool,
// Function module-specific validation and checking
ValidateFunctionModule_Tool,
CheckFunctionModule_Tool,
// Dynamically imported tools
...DYNAMIC_IMPORT_TOOLS
];
// Returns the entire tool list
export function getAllTools(): ToolDefinition[] {
return ALL_TOOLS;
}
// Finds a tool definition by name
export function getToolByName(name: string): ToolDefinition | undefined {
return ALL_TOOLS.find(tool => tool.name === name);
}