@ibm/ibmi-mcp-server 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +140 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +14 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/resolver.d.ts.map +1 -1
- package/dist/config/resolver.js.map +1 -1
- package/dist/ibmi-mcp-server/tools/executeSql.tool.d.ts +80 -0
- package/dist/ibmi-mcp-server/tools/executeSql.tool.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/tools/executeSql.tool.js +356 -0
- package/dist/ibmi-mcp-server/tools/executeSql.tool.js.map +1 -0
- package/dist/ibmi-mcp-server/tools/generateSql.tool.d.ts +36 -0
- package/dist/ibmi-mcp-server/tools/generateSql.tool.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/tools/generateSql.tool.js +281 -0
- package/dist/ibmi-mcp-server/tools/generateSql.tool.js.map +1 -0
- package/dist/ibmi-mcp-server/tools/index.d.ts +85 -0
- package/dist/ibmi-mcp-server/tools/index.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/tools/index.js +21 -0
- package/dist/ibmi-mcp-server/tools/index.js.map +1 -0
- package/dist/ibmi-mcp-server/utils/config/configParser.d.ts +9 -0
- package/dist/ibmi-mcp-server/utils/config/configParser.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/configParser.js +58 -0
- package/dist/ibmi-mcp-server/utils/config/configParser.js.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolDefinitions.d.ts +4 -4
- package/dist/ibmi-mcp-server/utils/config/toolDefinitions.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolDefinitions.js +7 -8
- package/dist/ibmi-mcp-server/utils/config/toolDefinitions.js.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolFactory.d.ts +0 -8
- package/dist/ibmi-mcp-server/utils/config/toolFactory.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolFactory.js +0 -31
- package/dist/ibmi-mcp-server/utils/config/toolFactory.js.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolsetManager.d.ts +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolsetManager.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolsetManager.js +2 -2
- package/dist/ibmi-mcp-server/utils/config/toolsetManager.js.map +1 -1
- package/dist/ibmi-mcp-server/utils/language/document.d.ts +26 -0
- package/dist/ibmi-mcp-server/utils/language/document.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/utils/language/document.js +318 -0
- package/dist/ibmi-mcp-server/utils/language/document.js.map +1 -0
- package/dist/ibmi-mcp-server/utils/language/statement.d.ts +43 -0
- package/dist/ibmi-mcp-server/utils/language/statement.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/utils/language/statement.js +796 -0
- package/dist/ibmi-mcp-server/utils/language/statement.js.map +1 -0
- package/dist/ibmi-mcp-server/utils/language/tokens.d.ts +32 -0
- package/dist/ibmi-mcp-server/utils/language/tokens.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/utils/language/tokens.js +532 -0
- package/dist/ibmi-mcp-server/utils/language/tokens.js.map +1 -0
- package/dist/ibmi-mcp-server/utils/language/types.d.ts +138 -0
- package/dist/ibmi-mcp-server/utils/language/types.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/utils/language/types.js +93 -0
- package/dist/ibmi-mcp-server/utils/language/types.js.map +1 -0
- package/dist/ibmi-mcp-server/utils/security/ibmiSqlParser.d.ts +48 -0
- package/dist/ibmi-mcp-server/utils/security/ibmiSqlParser.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/utils/security/ibmiSqlParser.js +93 -0
- package/dist/ibmi-mcp-server/utils/security/ibmiSqlParser.js.map +1 -0
- package/dist/ibmi-mcp-server/utils/security/sqlSecurityValidator.d.ts +35 -59
- package/dist/ibmi-mcp-server/utils/security/sqlSecurityValidator.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/utils/security/sqlSecurityValidator.js +108 -288
- package/dist/ibmi-mcp-server/utils/security/sqlSecurityValidator.js.map +1 -1
- package/dist/ibmi-mcp-server/utils/security/sqlSecurityValidatorFallback.d.ts +54 -0
- package/dist/ibmi-mcp-server/utils/security/sqlSecurityValidatorFallback.d.ts.map +1 -0
- package/dist/ibmi-mcp-server/utils/security/sqlSecurityValidatorFallback.js +91 -0
- package/dist/ibmi-mcp-server/utils/security/sqlSecurityValidatorFallback.js.map +1 -0
- package/dist/mcp-server/tools/index.d.ts +13 -2
- package/dist/mcp-server/tools/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/index.js +29 -9
- package/dist/mcp-server/tools/index.js.map +1 -1
- package/dist/mcp-server/tools/utils/index.d.ts +7 -0
- package/dist/mcp-server/tools/utils/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/utils/index.js +7 -0
- package/dist/mcp-server/tools/utils/index.js.map +1 -0
- package/dist/mcp-server/tools/utils/tool-factory.d.ts +129 -0
- package/dist/mcp-server/tools/utils/tool-factory.d.ts.map +1 -0
- package/dist/mcp-server/tools/utils/tool-factory.js +179 -0
- package/dist/mcp-server/tools/utils/tool-factory.js.map +1 -0
- package/dist/mcp-server/tools/utils/types.d.ts +117 -0
- package/dist/mcp-server/tools/utils/types.d.ts.map +1 -0
- package/dist/mcp-server/tools/utils/types.js +11 -0
- package/dist/mcp-server/tools/utils/types.js.map +1 -0
- package/dist/mcp-server/transports/core/cleanupTransformStream.d.ts +26 -0
- package/dist/mcp-server/transports/core/cleanupTransformStream.d.ts.map +1 -0
- package/dist/mcp-server/transports/core/cleanupTransformStream.js +60 -0
- package/dist/mcp-server/transports/core/cleanupTransformStream.js.map +1 -0
- package/dist/mcp-server/transports/core/statefulTransportManager.d.ts +1 -1
- package/dist/mcp-server/transports/core/statefulTransportManager.d.ts.map +1 -1
- package/dist/mcp-server/transports/core/statefulTransportManager.js +50 -40
- package/dist/mcp-server/transports/core/statefulTransportManager.js.map +1 -1
- package/dist/mcp-server/transports/core/statelessTransportManager.d.ts +2 -13
- package/dist/mcp-server/transports/core/statelessTransportManager.d.ts.map +1 -1
- package/dist/mcp-server/transports/core/statelessTransportManager.js +35 -62
- package/dist/mcp-server/transports/core/statelessTransportManager.js.map +1 -1
- package/dist/mcp-server/transports/core/transportRequest.d.ts +1 -2
- package/dist/mcp-server/transports/core/transportRequest.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/mcpTransportMiddleware.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/mcpTransportMiddleware.js +1 -3
- package/dist/mcp-server/transports/http/mcpTransportMiddleware.js.map +1 -1
- package/package.json +21 -22
- package/dist/ibmi-mcp-server/tools/executeSql/index.d.ts +0 -9
- package/dist/ibmi-mcp-server/tools/executeSql/index.d.ts.map +0 -1
- package/dist/ibmi-mcp-server/tools/executeSql/index.js +0 -9
- package/dist/ibmi-mcp-server/tools/executeSql/index.js.map +0 -1
- package/dist/ibmi-mcp-server/tools/executeSql/logic.d.ts +0 -51
- package/dist/ibmi-mcp-server/tools/executeSql/logic.d.ts.map +0 -1
- package/dist/ibmi-mcp-server/tools/executeSql/logic.js +0 -179
- package/dist/ibmi-mcp-server/tools/executeSql/logic.js.map +0 -1
- package/dist/ibmi-mcp-server/tools/executeSql/registration.d.ts +0 -52
- package/dist/ibmi-mcp-server/tools/executeSql/registration.d.ts.map +0 -1
- package/dist/ibmi-mcp-server/tools/executeSql/registration.js +0 -161
- package/dist/ibmi-mcp-server/tools/executeSql/registration.js.map +0 -1
- package/dist/ibmi-mcp-server/tools/generateSql/index.d.ts +0 -13
- package/dist/ibmi-mcp-server/tools/generateSql/index.d.ts.map +0 -1
- package/dist/ibmi-mcp-server/tools/generateSql/index.js +0 -13
- package/dist/ibmi-mcp-server/tools/generateSql/index.js.map +0 -1
- package/dist/ibmi-mcp-server/tools/generateSql/logic.d.ts +0 -64
- package/dist/ibmi-mcp-server/tools/generateSql/logic.d.ts.map +0 -1
- package/dist/ibmi-mcp-server/tools/generateSql/logic.js +0 -190
- package/dist/ibmi-mcp-server/tools/generateSql/logic.js.map +0 -1
- package/dist/ibmi-mcp-server/tools/generateSql/registration.d.ts +0 -18
- package/dist/ibmi-mcp-server/tools/generateSql/registration.d.ts.map +0 -1
- package/dist/ibmi-mcp-server/tools/generateSql/registration.js +0 -64
- package/dist/ibmi-mcp-server/tools/generateSql/registration.js.map +0 -1
- package/dist/mcp-server/tools/catFactFetcher/index.d.ts +0 -8
- package/dist/mcp-server/tools/catFactFetcher/index.d.ts.map +0 -1
- package/dist/mcp-server/tools/catFactFetcher/index.js +0 -8
- package/dist/mcp-server/tools/catFactFetcher/index.js.map +0 -1
- package/dist/mcp-server/tools/catFactFetcher/logic.d.ts +0 -52
- package/dist/mcp-server/tools/catFactFetcher/logic.d.ts.map +0 -1
- package/dist/mcp-server/tools/catFactFetcher/logic.js +0 -95
- package/dist/mcp-server/tools/catFactFetcher/logic.js.map +0 -1
- package/dist/mcp-server/tools/catFactFetcher/registration.d.ts +0 -9
- package/dist/mcp-server/tools/catFactFetcher/registration.d.ts.map +0 -1
- package/dist/mcp-server/tools/catFactFetcher/registration.js +0 -43
- package/dist/mcp-server/tools/catFactFetcher/registration.js.map +0 -1
- package/dist/mcp-server/tools/echoTool/index.d.ts +0 -13
- package/dist/mcp-server/tools/echoTool/index.d.ts.map +0 -1
- package/dist/mcp-server/tools/echoTool/index.js +0 -13
- package/dist/mcp-server/tools/echoTool/index.js.map +0 -1
- package/dist/mcp-server/tools/echoTool/logic.d.ts +0 -69
- package/dist/mcp-server/tools/echoTool/logic.d.ts.map +0 -1
- package/dist/mcp-server/tools/echoTool/logic.js +0 -119
- package/dist/mcp-server/tools/echoTool/logic.js.map +0 -1
- package/dist/mcp-server/tools/echoTool/registration.d.ts +0 -9
- package/dist/mcp-server/tools/echoTool/registration.d.ts.map +0 -1
- package/dist/mcp-server/tools/echoTool/registration.js +0 -45
- package/dist/mcp-server/tools/echoTool/registration.js.map +0 -1
- package/dist/mcp-server/tools/imageTest/index.d.ts +0 -7
- package/dist/mcp-server/tools/imageTest/index.d.ts.map +0 -1
- package/dist/mcp-server/tools/imageTest/index.js +0 -7
- package/dist/mcp-server/tools/imageTest/index.js.map +0 -1
- package/dist/mcp-server/tools/imageTest/logic.d.ts +0 -27
- package/dist/mcp-server/tools/imageTest/logic.d.ts.map +0 -1
- package/dist/mcp-server/tools/imageTest/logic.js +0 -44
- package/dist/mcp-server/tools/imageTest/logic.js.map +0 -1
- package/dist/mcp-server/tools/imageTest/registration.d.ts +0 -9
- package/dist/mcp-server/tools/imageTest/registration.d.ts.map +0 -1
- package/dist/mcp-server/tools/imageTest/registration.js +0 -49
- package/dist/mcp-server/tools/imageTest/registration.js.map +0 -1
- package/dist/mcp-server/tools/utils/tool-utils.d.ts +0 -43
- package/dist/mcp-server/tools/utils/tool-utils.d.ts.map +0 -1
- package/dist/mcp-server/tools/utils/tool-utils.js +0 -44
- package/dist/mcp-server/tools/utils/tool-utils.js.map +0 -1
- package/dist/mcp-server/transports/core/headerUtils.d.ts +0 -27
- package/dist/mcp-server/transports/core/headerUtils.d.ts.map +0 -1
- package/dist/mcp-server/transports/core/headerUtils.js +0 -53
- package/dist/mcp-server/transports/core/headerUtils.js.map +0 -1
- package/dist/mcp-server/transports/core/honoNodeBridge.d.ts +0 -77
- package/dist/mcp-server/transports/core/honoNodeBridge.d.ts.map +0 -1
- package/dist/mcp-server/transports/core/honoNodeBridge.js +0 -150
- package/dist/mcp-server/transports/core/honoNodeBridge.js.map +0 -1
- package/dist/services/duck-db/duckDBConnectionManager.d.ts +0 -55
- package/dist/services/duck-db/duckDBConnectionManager.d.ts.map +0 -1
- package/dist/services/duck-db/duckDBConnectionManager.js +0 -184
- package/dist/services/duck-db/duckDBConnectionManager.js.map +0 -1
- package/dist/services/duck-db/duckDBQueryExecutor.d.ts +0 -18
- package/dist/services/duck-db/duckDBQueryExecutor.d.ts.map +0 -1
- package/dist/services/duck-db/duckDBQueryExecutor.js +0 -115
- package/dist/services/duck-db/duckDBQueryExecutor.js.map +0 -1
- package/dist/services/duck-db/duckDBService.d.ts +0 -27
- package/dist/services/duck-db/duckDBService.d.ts.map +0 -1
- package/dist/services/duck-db/duckDBService.js +0 -151
- package/dist/services/duck-db/duckDBService.js.map +0 -1
- package/dist/services/duck-db/types.d.ts +0 -135
- package/dist/services/duck-db/types.d.ts.map +0 -1
- package/dist/services/duck-db/types.js +0 -6
- package/dist/services/duck-db/types.js.map +0 -1
- package/dist/services/llm-providers/openRouterProvider.d.ts +0 -36
- package/dist/services/llm-providers/openRouterProvider.d.ts.map +0 -1
- package/dist/services/llm-providers/openRouterProvider.js +0 -235
- package/dist/services/llm-providers/openRouterProvider.js.map +0 -1
- package/dist/services/supabase/supabaseClient.d.ts +0 -25
- package/dist/services/supabase/supabaseClient.d.ts.map +0 -1
- package/dist/services/supabase/supabaseClient.js +0 -68
- package/dist/services/supabase/supabaseClient.js.map +0 -1
- package/dist/storage/duckdbExample.d.ts +0 -8
- package/dist/storage/duckdbExample.d.ts.map +0 -1
- package/dist/storage/duckdbExample.js +0 -197
- package/dist/storage/duckdbExample.js.map +0 -1
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Defines the core logic, schemas, and types for the `generate_sql` tool.
|
|
3
|
-
* This module is the single source of truth for the tool's data contracts (Zod schemas)
|
|
4
|
-
* and its pure business logic for generating SQL DDL statements from IBM i database objects.
|
|
5
|
-
* @module src/mcp-server/tools/generateSql/logic
|
|
6
|
-
* @see {@link src/mcp-server/tools/generateSql/registration.ts} for the handler and registration logic.
|
|
7
|
-
*/
|
|
8
|
-
import { z } from "zod";
|
|
9
|
-
import { JsonRpcErrorCode, McpError } from "../../../types-global/errors.js";
|
|
10
|
-
import { getRequestContext } from "../../../utils/index.js";
|
|
11
|
-
import { logger } from "../../../utils/internal/logger.js";
|
|
12
|
-
import { IBMiConnectionPool } from "../../services/connectionPool.js";
|
|
13
|
-
/**
|
|
14
|
-
* Supported IBM i database object types for DDL generation.
|
|
15
|
-
* These correspond to the valid values for the DATABASE_OBJECT_TYPE parameter
|
|
16
|
-
* of the QSYS2.GENERATE_SQL stored procedure.
|
|
17
|
-
*/
|
|
18
|
-
const OBJECT_TYPES = [
|
|
19
|
-
"ALIAS",
|
|
20
|
-
"CONSTRAINT",
|
|
21
|
-
"FUNCTION",
|
|
22
|
-
"INDEX",
|
|
23
|
-
"MASK",
|
|
24
|
-
"PERMISSION",
|
|
25
|
-
"PROCEDURE",
|
|
26
|
-
"SCHEMA",
|
|
27
|
-
"SEQUENCE",
|
|
28
|
-
"TABLE",
|
|
29
|
-
"TRIGGER",
|
|
30
|
-
"TYPE",
|
|
31
|
-
"VARIABLE",
|
|
32
|
-
"VIEW",
|
|
33
|
-
"XSR",
|
|
34
|
-
];
|
|
35
|
-
/**
|
|
36
|
-
* Zod schema defining the input parameters for the `generate_sql` tool.
|
|
37
|
-
*/
|
|
38
|
-
export const GenerateSqlInputSchema = z
|
|
39
|
-
.object({
|
|
40
|
-
object_name: z
|
|
41
|
-
.string()
|
|
42
|
-
.min(1, "Object name cannot be empty.")
|
|
43
|
-
.max(128, "Object name cannot exceed 128 characters.")
|
|
44
|
-
.describe("The name of the IBM i database object to generate DDL for."),
|
|
45
|
-
object_library: z
|
|
46
|
-
.string()
|
|
47
|
-
.min(1, "Library name cannot be empty.")
|
|
48
|
-
.max(128, "Library name cannot exceed 128 characters.")
|
|
49
|
-
.default("QSYS2")
|
|
50
|
-
.describe("The library where the database object is located. Defaults to QSYS2."),
|
|
51
|
-
object_type: z
|
|
52
|
-
.enum(OBJECT_TYPES)
|
|
53
|
-
.default("TABLE")
|
|
54
|
-
.describe("The type of database object to generate DDL for. Valid types include TABLE, VIEW, INDEX, PROCEDURE, FUNCTION, etc."),
|
|
55
|
-
})
|
|
56
|
-
.describe("Input schema for generating SQL DDL");
|
|
57
|
-
/**
|
|
58
|
-
* Zod schema for the successful response of the `generate_sql` tool.
|
|
59
|
-
* Contains the generated DDL along with metadata about the source object.
|
|
60
|
-
*/
|
|
61
|
-
export const GenerateSqlOutputSchema = z
|
|
62
|
-
.object({
|
|
63
|
-
sql: z
|
|
64
|
-
.string()
|
|
65
|
-
.min(1, "Generated SQL cannot be empty.")
|
|
66
|
-
.describe("The generated DDL SQL statements for the specified database object."),
|
|
67
|
-
object_name: z
|
|
68
|
-
.string()
|
|
69
|
-
.describe("The name of the object the DDL was generated for."),
|
|
70
|
-
object_library: z
|
|
71
|
-
.string()
|
|
72
|
-
.describe("The library of the object the DDL was generated for."),
|
|
73
|
-
object_type: z
|
|
74
|
-
.string()
|
|
75
|
-
.describe("The type of the object the DDL was generated for."),
|
|
76
|
-
})
|
|
77
|
-
.describe("Output schema for generated SQL DDL");
|
|
78
|
-
/**
|
|
79
|
-
* Processes the core logic for the `generate_sql` tool.
|
|
80
|
-
* This function calls the QSYS2.GENERATE_SQL procedure to generate DDL for IBM i database objects.
|
|
81
|
-
*
|
|
82
|
-
* @param params - The validated input parameters containing object details
|
|
83
|
-
* @returns A promise resolving with the generated SQL DDL
|
|
84
|
-
* @throws {McpError} If the SQL generation encounters an unrecoverable issue
|
|
85
|
-
*/
|
|
86
|
-
export async function generateSqlLogic(params) {
|
|
87
|
-
const context = getRequestContext();
|
|
88
|
-
logger.debug({ ...context, toolInput: params }, "Processing generate SQL DDL logic.");
|
|
89
|
-
const sql = `CALL QSYS2.GENERATE_SQL(
|
|
90
|
-
DATABASE_OBJECT_NAME => ?,
|
|
91
|
-
DATABASE_OBJECT_LIBRARY_NAME => ?,
|
|
92
|
-
DATABASE_OBJECT_TYPE => ?,
|
|
93
|
-
CREATE_OR_REPLACE_OPTION => '1',
|
|
94
|
-
PRIVILEGES_OPTION => '0',
|
|
95
|
-
STATEMENT_FORMATTING_OPTION => '0',
|
|
96
|
-
SOURCE_STREAM_FILE_END_OF_LINE => 'LF',
|
|
97
|
-
SOURCE_STREAM_FILE_CCSID => 1208
|
|
98
|
-
)`;
|
|
99
|
-
const startTime = Date.now();
|
|
100
|
-
try {
|
|
101
|
-
// Execute the GENERATE_SQL procedure using pagination to get all results
|
|
102
|
-
const result = await IBMiConnectionPool.executeQueryWithPagination(sql, [params.object_name, params.object_library, params.object_type], context, 500);
|
|
103
|
-
const executionTime = Date.now() - startTime;
|
|
104
|
-
if (!result.success) {
|
|
105
|
-
throw new McpError(JsonRpcErrorCode.DatabaseError, "SQL DDL generation failed", {
|
|
106
|
-
objectName: params.object_name,
|
|
107
|
-
objectLibrary: params.object_library,
|
|
108
|
-
objectType: params.object_type,
|
|
109
|
-
sqlReturnCode: result.sql_rc,
|
|
110
|
-
executionTime,
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
// Process the result data to extract the generated DDL
|
|
114
|
-
let generatedSql = "";
|
|
115
|
-
if (result.data && Array.isArray(result.data)) {
|
|
116
|
-
logger.debug({
|
|
117
|
-
...context,
|
|
118
|
-
totalRows: result.data.length,
|
|
119
|
-
firstRowKeys: result.data[0] ? Object.keys(result.data[0]) : [],
|
|
120
|
-
}, "Processing GENERATE_SQL result data.");
|
|
121
|
-
// Build the result string from the SRCDTA column
|
|
122
|
-
// Results are already in correct order from the paginated query
|
|
123
|
-
const resultStrings = [];
|
|
124
|
-
for (const res of result.data) {
|
|
125
|
-
if (res && typeof res === "object" && "SRCDTA" in res) {
|
|
126
|
-
const srcData = res.SRCDTA;
|
|
127
|
-
if (srcData && typeof srcData === "string") {
|
|
128
|
-
resultStrings.push(srcData);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
generatedSql = resultStrings.join("\n");
|
|
133
|
-
logger.debug({
|
|
134
|
-
...context,
|
|
135
|
-
processedRows: resultStrings.length,
|
|
136
|
-
totalDdlLength: generatedSql.length,
|
|
137
|
-
avgRowLength: resultStrings.length > 0
|
|
138
|
-
? Math.round(generatedSql.length / resultStrings.length)
|
|
139
|
-
: 0,
|
|
140
|
-
}, "DDL extraction completed.");
|
|
141
|
-
}
|
|
142
|
-
if (!generatedSql || generatedSql.trim().length === 0) {
|
|
143
|
-
throw new McpError(JsonRpcErrorCode.DatabaseError, "No SQL DDL generated for the specified object", {
|
|
144
|
-
objectName: params.object_name,
|
|
145
|
-
objectLibrary: params.object_library,
|
|
146
|
-
objectType: params.object_type,
|
|
147
|
-
resultRowCount: result.data?.length || 0,
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
const response = {
|
|
151
|
-
sql: generatedSql.trim(),
|
|
152
|
-
object_name: params.object_name,
|
|
153
|
-
object_library: params.object_library,
|
|
154
|
-
object_type: params.object_type,
|
|
155
|
-
};
|
|
156
|
-
logger.debug({
|
|
157
|
-
...context,
|
|
158
|
-
objectName: params.object_name,
|
|
159
|
-
objectLibrary: params.object_library,
|
|
160
|
-
objectType: params.object_type,
|
|
161
|
-
sqlLength: response.sql.length,
|
|
162
|
-
executionTime,
|
|
163
|
-
rowCount: result.data?.length || 0,
|
|
164
|
-
}, "SQL DDL generated successfully.");
|
|
165
|
-
return response;
|
|
166
|
-
}
|
|
167
|
-
catch (error) {
|
|
168
|
-
const executionTime = Date.now() - startTime;
|
|
169
|
-
logger.error({
|
|
170
|
-
...context,
|
|
171
|
-
error: error instanceof Error ? error.message : String(error),
|
|
172
|
-
objectName: params.object_name,
|
|
173
|
-
objectLibrary: params.object_library,
|
|
174
|
-
objectType: params.object_type,
|
|
175
|
-
executionTime,
|
|
176
|
-
}, "SQL DDL generation failed.");
|
|
177
|
-
// Re-throw McpErrors as-is, wrap other errors
|
|
178
|
-
if (error instanceof McpError) {
|
|
179
|
-
throw error;
|
|
180
|
-
}
|
|
181
|
-
throw new McpError(JsonRpcErrorCode.DatabaseError, `SQL DDL generation failed: ${error instanceof Error ? error.message : String(error)}`, {
|
|
182
|
-
objectName: params.object_name,
|
|
183
|
-
objectLibrary: params.object_library,
|
|
184
|
-
objectType: params.object_type,
|
|
185
|
-
executionTime,
|
|
186
|
-
originalError: error instanceof Error ? error.name : "Unknown",
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
//# sourceMappingURL=logic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logic.js","sourceRoot":"","sources":["../../../../src/ibmi-mcp-server/tools/generateSql/logic.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE;;;;GAIG;AACH,MAAM,YAAY,GAAG;IACnB,OAAO;IACP,YAAY;IACZ,UAAU;IACV,OAAO;IACP,MAAM;IACN,YAAY;IACZ,WAAW;IACX,QAAQ;IACR,UAAU;IACV,OAAO;IACP,SAAS;IACT,MAAM;IACN,UAAU;IACV,MAAM;IACN,KAAK;CACG,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC;KACpC,MAAM,CAAC;IACN,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,EAAE,8BAA8B,CAAC;SACtC,GAAG,CAAC,GAAG,EAAE,2CAA2C,CAAC;SACrD,QAAQ,CAAC,4DAA4D,CAAC;IACzE,cAAc,EAAE,CAAC;SACd,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,EAAE,+BAA+B,CAAC;SACvC,GAAG,CAAC,GAAG,EAAE,4CAA4C,CAAC;SACtD,OAAO,CAAC,OAAO,CAAC;SAChB,QAAQ,CACP,sEAAsE,CACvE;IACH,WAAW,EAAE,CAAC;SACX,IAAI,CAAC,YAAY,CAAC;SAClB,OAAO,CAAC,OAAO,CAAC;SAChB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QAE7C,MAAM,CAAC,KAAK,CACV;YACE,GAAG,OAAO;YACV,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;YAC7D,UAAU,EAAE,MAAM,CAAC,WAAW;YAC9B,aAAa,EAAE,MAAM,CAAC,cAAc;YACpC,UAAU,EAAE,MAAM,CAAC,WAAW;YAC9B,aAAa;SACd,EACD,4BAA4B,CAC7B,CAAC;QAEF,8CAA8C;QAC9C,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;YAC9B,MAAM,KAAK,CAAC;QACd,CAAC;QAED,MAAM,IAAI,QAAQ,CAChB,gBAAgB,CAAC,aAAa,EAC9B,8BAA8B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EACtF;YACE,UAAU,EAAE,MAAM,CAAC,WAAW;YAC9B,aAAa,EAAE,MAAM,CAAC,cAAc;YACpC,UAAU,EAAE,MAAM,CAAC,WAAW;YAC9B,aAAa;YACb,aAAa,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;SAC/D,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Handles registration and error handling for the `generate_sql` tool.
|
|
3
|
-
* This module acts as the "handler" layer, connecting the pure business logic to the
|
|
4
|
-
* MCP server and ensuring all outcomes (success or failure) are handled gracefully.
|
|
5
|
-
* @module src/mcp-server/tools/generateSql/registration
|
|
6
|
-
* @see {@link src/mcp-server/tools/generateSql/logic.ts} for the core business logic and schemas.
|
|
7
|
-
*/
|
|
8
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
9
|
-
export declare const TOOL_NAME = "describe_sql_object";
|
|
10
|
-
/**
|
|
11
|
-
* Registers the 'generate_sql' tool and its handler with the provided MCP server instance.
|
|
12
|
-
* This function uses ErrorHandler.tryCatch to ensure that any failure during the
|
|
13
|
-
* registration process itself is caught and logged, preventing server startup failures.
|
|
14
|
-
*
|
|
15
|
-
* @param server - The MCP server instance to register the tool with.
|
|
16
|
-
*/
|
|
17
|
-
export declare const registerGenerateSqlTool: (server: McpServer) => Promise<void>;
|
|
18
|
-
//# sourceMappingURL=registration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registration.d.ts","sourceRoot":"","sources":["../../../../src/ibmi-mcp-server/tools/generateSql/registration.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAoBpE,eAAO,MAAM,SAAS,wBAAwB,CAAC;AAmB/C;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,GAClC,QAAQ,SAAS,KAChB,OAAO,CAAC,IAAI,CA0Cd,CAAC"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Handles registration and error handling for the `generate_sql` tool.
|
|
3
|
-
* This module acts as the "handler" layer, connecting the pure business logic to the
|
|
4
|
-
* MCP server and ensuring all outcomes (success or failure) are handled gracefully.
|
|
5
|
-
* @module src/mcp-server/tools/generateSql/registration
|
|
6
|
-
* @see {@link src/mcp-server/tools/generateSql/logic.ts} for the core business logic and schemas.
|
|
7
|
-
*/
|
|
8
|
-
import { JsonRpcErrorCode } from "../../../types-global/errors.js";
|
|
9
|
-
import { ErrorHandler, requestContextService } from "../../../utils/index.js";
|
|
10
|
-
import { ToolsetManager } from "../../utils/config/toolsetManager.js";
|
|
11
|
-
import { logOperationStart, logOperationSuccess, } from "../../../utils/internal/logging-helpers.js";
|
|
12
|
-
import { createToolHandler, } from "../../../mcp-server/tools/utils/tool-utils.js";
|
|
13
|
-
import { GenerateSqlInputSchema, generateSqlLogic, GenerateSqlOutputSchema, } from "./logic.js";
|
|
14
|
-
// The unique name for the tool, used for registration and identification.
|
|
15
|
-
export const TOOL_NAME = "describe_sql_object";
|
|
16
|
-
// A concise description for the LLM. More detailed guidance should be in the
|
|
17
|
-
// parameter descriptions within the Zod schema in `logic.ts`.
|
|
18
|
-
const TOOL_DESCRIPTION = "Describes IBM i database objects by generating their SQL DDL statements. Useful for understanding object structure and recreating objects.";
|
|
19
|
-
const responseFormatter = (result) => ({
|
|
20
|
-
structuredContent: result,
|
|
21
|
-
content: [
|
|
22
|
-
{
|
|
23
|
-
type: "text",
|
|
24
|
-
text: `Successfully generated SQL DDL for ${result.object_type} '${result.object_name}' in library '${result.object_library}':\n\n${result.sql}`,
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
});
|
|
28
|
-
/**
|
|
29
|
-
* Registers the 'generate_sql' tool and its handler with the provided MCP server instance.
|
|
30
|
-
* This function uses ErrorHandler.tryCatch to ensure that any failure during the
|
|
31
|
-
* registration process itself is caught and logged, preventing server startup failures.
|
|
32
|
-
*
|
|
33
|
-
* @param server - The MCP server instance to register the tool with.
|
|
34
|
-
*/
|
|
35
|
-
export const registerGenerateSqlTool = async (server) => {
|
|
36
|
-
const registrationContext = requestContextService.createRequestContext({
|
|
37
|
-
operation: "RegisterTool",
|
|
38
|
-
toolName: TOOL_NAME,
|
|
39
|
-
});
|
|
40
|
-
logOperationStart(registrationContext, `Registering tool: '${TOOL_NAME}'`);
|
|
41
|
-
await ErrorHandler.tryCatch(async () => {
|
|
42
|
-
// Get toolset metadata for global tool
|
|
43
|
-
const toolsetManager = ToolsetManager.getInstance();
|
|
44
|
-
const toolsetMetadata = toolsetManager.generateToolMetadata(TOOL_NAME);
|
|
45
|
-
server.registerTool(TOOL_NAME, {
|
|
46
|
-
title: "Generate SQL DDL",
|
|
47
|
-
description: TOOL_DESCRIPTION,
|
|
48
|
-
inputSchema: GenerateSqlInputSchema.shape,
|
|
49
|
-
outputSchema: GenerateSqlOutputSchema.shape,
|
|
50
|
-
annotations: {
|
|
51
|
-
readOnlyHint: false, // This tool generates DDL which could be used for schema changes
|
|
52
|
-
openWorldHint: false, // This tool interacts with the IBM i database system
|
|
53
|
-
...toolsetMetadata, // Add toolset metadata for filtering
|
|
54
|
-
},
|
|
55
|
-
}, createToolHandler(TOOL_NAME, generateSqlLogic, responseFormatter));
|
|
56
|
-
logOperationSuccess(registrationContext, `Tool '${TOOL_NAME}' registered successfully.`);
|
|
57
|
-
}, {
|
|
58
|
-
operation: `RegisteringTool_${TOOL_NAME}`,
|
|
59
|
-
context: registrationContext,
|
|
60
|
-
errorCode: JsonRpcErrorCode.InitializationFailed,
|
|
61
|
-
critical: true, // A failure to register a tool is a critical startup error.
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=registration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registration.js","sourceRoot":"","sources":["../../../../src/ibmi-mcp-server/tools/generateSql/registration.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,iBAAiB,GAElB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAEhB,uBAAuB,GACxB,MAAM,YAAY,CAAC;AAEpB,0EAA0E;AAC1E,MAAM,CAAC,MAAM,SAAS,GAAG,qBAAqB,CAAC;AAE/C,6EAA6E;AAC7E,8DAA8D;AAC9D,MAAM,gBAAgB,GACpB,4IAA4I,CAAC;AAE/I,MAAM,iBAAiB,GAAyC,CAC9D,MAAyB,EACzB,EAAE,CAAC,C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AAmB;QAC5B,SAAS,EAAE,gBAAgB,CAAC,oBAAoB;QAChD,QAAQ,EAAE,IAAI,EAAE,4DAA4D;KAC7E,CACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Barrel file for the `catFactFetcher` tool.
|
|
3
|
-
* This file serves as the public interface for the cat fact fetcher tool module,
|
|
4
|
-
* primarily exporting the `registerCatFactFetcherTool` function.
|
|
5
|
-
* @module src/mcp-server/tools/catFactFetcher/index
|
|
6
|
-
*/
|
|
7
|
-
export { registerCatFactFetcherTool } from "./registration.js";
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/catFactFetcher/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Barrel file for the `catFactFetcher` tool.
|
|
3
|
-
* This file serves as the public interface for the cat fact fetcher tool module,
|
|
4
|
-
* primarily exporting the `registerCatFactFetcherTool` function.
|
|
5
|
-
* @module src/mcp-server/tools/catFactFetcher/index
|
|
6
|
-
*/
|
|
7
|
-
export { registerCatFactFetcherTool } from "./registration.js";
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/catFactFetcher/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Defines the core logic, schemas, and types for the `get_random_cat_fact` tool.
|
|
3
|
-
* This tool fetches a random cat fact from the public Cat Fact Ninja API.
|
|
4
|
-
* @module src/mcp-server/tools/catFactFetcher/logic
|
|
5
|
-
**/
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
/**
|
|
8
|
-
* Zod schema for validating input arguments for the `get_random_cat_fact` tool.
|
|
9
|
-
*/
|
|
10
|
-
export declare const CatFactFetcherInputSchema: z.ZodObject<{
|
|
11
|
-
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
maxLength?: number | undefined;
|
|
14
|
-
}, {
|
|
15
|
-
maxLength?: number | undefined;
|
|
16
|
-
}>;
|
|
17
|
-
/**
|
|
18
|
-
* TypeScript type inferred from `CatFactFetcherInputSchema`.
|
|
19
|
-
*/
|
|
20
|
-
export type CatFactFetcherInput = z.infer<typeof CatFactFetcherInputSchema>;
|
|
21
|
-
/**
|
|
22
|
-
* Zod schema for the successful response of the `get_random_cat_fact` tool.
|
|
23
|
-
*/
|
|
24
|
-
export declare const CatFactFetcherResponseSchema: z.ZodObject<{
|
|
25
|
-
fact: z.ZodString;
|
|
26
|
-
length: z.ZodNumber;
|
|
27
|
-
requestedMaxLength: z.ZodOptional<z.ZodNumber>;
|
|
28
|
-
timestamp: z.ZodString;
|
|
29
|
-
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
length: number;
|
|
31
|
-
timestamp: string;
|
|
32
|
-
fact: string;
|
|
33
|
-
requestedMaxLength?: number | undefined;
|
|
34
|
-
}, {
|
|
35
|
-
length: number;
|
|
36
|
-
timestamp: string;
|
|
37
|
-
fact: string;
|
|
38
|
-
requestedMaxLength?: number | undefined;
|
|
39
|
-
}>;
|
|
40
|
-
/**
|
|
41
|
-
* Defines the structure of the JSON payload returned by the `get_random_cat_fact` tool handler.
|
|
42
|
-
*/
|
|
43
|
-
export type CatFactFetcherResponse = z.infer<typeof CatFactFetcherResponseSchema>;
|
|
44
|
-
/**
|
|
45
|
-
* Processes the core logic for the `get_random_cat_fact` tool.
|
|
46
|
-
* It calls the Cat Fact Ninja API and returns the fetched fact.
|
|
47
|
-
* @param params - The validated input parameters for the tool.
|
|
48
|
-
* @returns A promise that resolves to an object containing the cat fact data.
|
|
49
|
-
* @throws {McpError} If the API request fails or returns an error.
|
|
50
|
-
*/
|
|
51
|
-
export declare function catFactFetcherLogic(params: CatFactFetcherInput): Promise<CatFactFetcherResponse>;
|
|
52
|
-
//# sourceMappingURL=logic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logic.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/catFactFetcher/logic.ts"],"names":[],"mappings":"AAAA;;;;IAII;AAEJ,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsBxB;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;EASpC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;EAYvC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,sBAAsB,CAAC,CA0EjC"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Defines the core logic, schemas, and types for the `get_random_cat_fact` tool.
|
|
3
|
-
* This tool fetches a random cat fact from the public Cat Fact Ninja API.
|
|
4
|
-
* @module src/mcp-server/tools/catFactFetcher/logic
|
|
5
|
-
**/
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { JsonRpcErrorCode, McpError } from "../../../types-global/errors.js";
|
|
8
|
-
import { fetchWithTimeout, getRequestContext, requestContextService, } from "../../../utils/index.js";
|
|
9
|
-
import { logOperationError, logOperationStart, logOperationSuccess, } from "../../../utils/internal/logging-helpers.js";
|
|
10
|
-
/**
|
|
11
|
-
* Zod schema for the raw response from the Cat Fact Ninja API.
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
const CatFactApiSchema = z.object({
|
|
15
|
-
fact: z.string(),
|
|
16
|
-
length: z.number(),
|
|
17
|
-
});
|
|
18
|
-
/**
|
|
19
|
-
* Zod schema for validating input arguments for the `get_random_cat_fact` tool.
|
|
20
|
-
*/
|
|
21
|
-
export const CatFactFetcherInputSchema = z.object({
|
|
22
|
-
maxLength: z
|
|
23
|
-
.number()
|
|
24
|
-
.int("Max length must be an integer.")
|
|
25
|
-
.min(1, "Max length must be at least 1.")
|
|
26
|
-
.optional()
|
|
27
|
-
.describe("Optional: The maximum character length of the cat fact to retrieve."),
|
|
28
|
-
});
|
|
29
|
-
/**
|
|
30
|
-
* Zod schema for the successful response of the `get_random_cat_fact` tool.
|
|
31
|
-
*/
|
|
32
|
-
export const CatFactFetcherResponseSchema = z.object({
|
|
33
|
-
fact: z.string().describe("The retrieved cat fact."),
|
|
34
|
-
length: z.number().int().describe("The character length of the cat fact."),
|
|
35
|
-
requestedMaxLength: z
|
|
36
|
-
.number()
|
|
37
|
-
.int()
|
|
38
|
-
.optional()
|
|
39
|
-
.describe("The maximum length that was requested for the fact."),
|
|
40
|
-
timestamp: z
|
|
41
|
-
.string()
|
|
42
|
-
.datetime()
|
|
43
|
-
.describe("ISO 8601 timestamp of when the response was generated."),
|
|
44
|
-
});
|
|
45
|
-
/**
|
|
46
|
-
* Processes the core logic for the `get_random_cat_fact` tool.
|
|
47
|
-
* It calls the Cat Fact Ninja API and returns the fetched fact.
|
|
48
|
-
* @param params - The validated input parameters for the tool.
|
|
49
|
-
* @returns A promise that resolves to an object containing the cat fact data.
|
|
50
|
-
* @throws {McpError} If the API request fails or returns an error.
|
|
51
|
-
*/
|
|
52
|
-
export async function catFactFetcherLogic(params) {
|
|
53
|
-
const context = getRequestContext() ??
|
|
54
|
-
requestContextService.createRequestContext({
|
|
55
|
-
operation: "catFactFetcherLogic",
|
|
56
|
-
});
|
|
57
|
-
logOperationStart(context, "Processing get_random_cat_fact logic.", {
|
|
58
|
-
toolInput: params,
|
|
59
|
-
});
|
|
60
|
-
let apiUrl = "https://catfact.ninja/fact";
|
|
61
|
-
if (params.maxLength !== undefined) {
|
|
62
|
-
apiUrl += `?max_length=${params.maxLength}`;
|
|
63
|
-
}
|
|
64
|
-
logOperationStart(context, `Fetching random cat fact from: ${apiUrl}`);
|
|
65
|
-
const CAT_FACT_API_TIMEOUT_MS = 5000;
|
|
66
|
-
const response = await fetchWithTimeout(apiUrl, CAT_FACT_API_TIMEOUT_MS, context);
|
|
67
|
-
if (!response.ok) {
|
|
68
|
-
const errorText = await response.text();
|
|
69
|
-
throw new McpError(JsonRpcErrorCode.ServiceUnavailable, `Cat Fact API request failed: ${response.status} ${response.statusText}`, {
|
|
70
|
-
...context,
|
|
71
|
-
httpStatusCode: response.status,
|
|
72
|
-
responseBody: errorText,
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
const rawData = await response.json();
|
|
76
|
-
try {
|
|
77
|
-
const data = CatFactApiSchema.parse(rawData);
|
|
78
|
-
const toolResponse = {
|
|
79
|
-
fact: data.fact,
|
|
80
|
-
length: data.length,
|
|
81
|
-
requestedMaxLength: params.maxLength,
|
|
82
|
-
timestamp: new Date().toISOString(),
|
|
83
|
-
};
|
|
84
|
-
logOperationSuccess(context, "Random cat fact fetched and processed successfully.", { factLength: toolResponse.length });
|
|
85
|
-
return toolResponse;
|
|
86
|
-
}
|
|
87
|
-
catch (validationError) {
|
|
88
|
-
logOperationError(context, "Cat Fact API response validation failed", validationError, { receivedData: rawData });
|
|
89
|
-
throw new McpError(JsonRpcErrorCode.ServiceUnavailable, "Cat Fact API returned unexpected data format.", {
|
|
90
|
-
...context,
|
|
91
|
-
cause: validationError,
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=logic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logic.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/catFactFetcher/logic.ts"],"names":[],"mappings":"AAAA;;;;IAII;AAEJ,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,qCAAqC,CAAC;AAE7C;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,gCAAgC,CAAC;SACrC,GAAG,CAAC,CAAC,EAAE,gCAAgC,CAAC;SACxC,QAAQ,EAAE;SACV,QAAQ,CACP,qEAAqE,CACtE;CACJ,CAAC,CAAC;AAOH;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IACpD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IAC1E,kBAAkB,EAAE,CAAC;SAClB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,QAA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OAAO,CAAC,CAAC;QAE7C,MAAM,YAAY,GAA2B;YAC3C,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,kBAAkB,EAAE,MAAM,CAAC,SAAS;YACpC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACpC,CAAC;QAEF,mBAAmB,CACjB,OAAO,EACP,qDAAqD,EACrD,EAAE,UAAU,EAAE,YAAY,CAAC,MAAM,EAAE,CACpC,CAAC;QAEF,OAAO,YAAY,CAAC;IACtB,CAAC;IAAC,OAAO,eAAe,EAAE,CAAC;QACzB,iBAAiB,CACf,OAAO,EACP,yCAAyC,EACzC,eAAe,EACf,EAAE,YAAY,EAAE,OAAO,EAAE,CAC1B,CAAC;QACF,MAAM,IAAI,QAAQ,CAChB,gBAAgB,CAAC,kBAAkB,EACnC,+CAA+C,EAC/C;YACE,GAAG,OAAO;YACV,KAAK,EAAE,eAAe;SACvB,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Handles the registration of the `get_random_cat_fact` tool.
|
|
3
|
-
* This module acts as the "handler" layer, connecting the pure business logic to the
|
|
4
|
-
* MCP server and ensuring all outcomes (success or failure) are handled gracefully.
|
|
5
|
-
* @module src/mcp-server/tools/catFactFetcher/registration
|
|
6
|
-
**/
|
|
7
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
8
|
-
export declare const registerCatFactFetcherTool: (server: McpServer) => Promise<void>;
|
|
9
|
-
//# sourceMappingURL=registration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registration.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/catFactFetcher/registration.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA6BpE,eAAO,MAAM,0BAA0B,GACrC,QAAQ,SAAS,KAChB,OAAO,CAAC,IAAI,CAqCd,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Handles the registration of the `get_random_cat_fact` tool.
|
|
3
|
-
* This module acts as the "handler" layer, connecting the pure business logic to the
|
|
4
|
-
* MCP server and ensuring all outcomes (success or failure) are handled gracefully.
|
|
5
|
-
* @module src/mcp-server/tools/catFactFetcher/registration
|
|
6
|
-
**/
|
|
7
|
-
import { JsonRpcErrorCode } from "../../../types-global/errors.js";
|
|
8
|
-
import { ErrorHandler, requestContextService } from "../../../utils/index.js";
|
|
9
|
-
import { logOperationStart, logOperationSuccess, } from "../../../utils/internal/logging-helpers.js";
|
|
10
|
-
import { createToolHandler, } from "../../tools/utils/tool-utils.js";
|
|
11
|
-
import { CatFactFetcherInputSchema, catFactFetcherLogic, CatFactFetcherResponseSchema, } from "./logic.js";
|
|
12
|
-
const TOOL_NAME = "get_random_cat_fact";
|
|
13
|
-
const TOOL_DESCRIPTION = "Fetches a random cat fact from a public API. Optionally, a maximum length for the fact can be specified.";
|
|
14
|
-
const responseFormatter = (result) => ({
|
|
15
|
-
structuredContent: result,
|
|
16
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
17
|
-
});
|
|
18
|
-
export const registerCatFactFetcherTool = async (server) => {
|
|
19
|
-
const registrationContext = requestContextService.createRequestContext({
|
|
20
|
-
operation: "RegisterTool",
|
|
21
|
-
toolName: TOOL_NAME,
|
|
22
|
-
});
|
|
23
|
-
logOperationStart(registrationContext, `Registering tool: '${TOOL_NAME}'`);
|
|
24
|
-
await ErrorHandler.tryCatch(async () => {
|
|
25
|
-
server.registerTool(TOOL_NAME, {
|
|
26
|
-
title: "Get Random Cat Fact",
|
|
27
|
-
description: TOOL_DESCRIPTION,
|
|
28
|
-
inputSchema: CatFactFetcherInputSchema.shape,
|
|
29
|
-
outputSchema: CatFactFetcherResponseSchema.shape,
|
|
30
|
-
annotations: {
|
|
31
|
-
readOnlyHint: true,
|
|
32
|
-
openWorldHint: true,
|
|
33
|
-
},
|
|
34
|
-
}, createToolHandler(TOOL_NAME, catFactFetcherLogic, responseFormatter));
|
|
35
|
-
logOperationSuccess(registrationContext, `Tool '${TOOL_NAME}' registered successfully.`);
|
|
36
|
-
}, {
|
|
37
|
-
operation: `RegisteringTool_${TOOL_NAME}`,
|
|
38
|
-
context: registrationContext,
|
|
39
|
-
errorCode: JsonRpcErrorCode.InitializationFailed,
|
|
40
|
-
critical: true,
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=registration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registration.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/catFactFetcher/registration.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAGJ,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,iBAAiB,GAElB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EAEnB,4BAA4B,GAC7B,MAAM,YAAY,CAAC;AAEpB,MAAM,SAAS,GAAG,qBAAqB,CAAC;AACxC,MAAM,gBAAgB,GACpB,0GAA0G,CAAC;AAE7G,MAAM,iBAAiB,GAA8C,CACnE,MAAM,EACN,EAAE,CAAC,CAAC;IACJ,iBAAiB,EAAE,MAAM;IACzB,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;CACnE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,EAC7C,MAAiB,EACF,EAAE;IACjB,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,oBAAoB,CAAC;QACrE,SAAS,EAAE,cAAc;QACzB,QAAQ,EAAE,SAAS;KACpB,CAAC,CAAC;IAEH,iBAAiB,CAAC,mBAAmB,EAAE,sBAAsB,SAAS,GAAG,CAAC,CAAC;IAE3E,MAAM,YAAY,CAAC,QAAQ,CACzB,KAAK,IAAI,EAAE;QACT,MAAM,CAAC,YAAY,CACjB,SAAS,EACT;YACE,KAAK,EAAE,qBAAqB;YAC5B,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,yBAAyB,CAAC,KAAK;YAC5C,YAAY,EAAE,4BAA4B,CAAC,KAAK;YAChD,WAAW,EAAE;gBACX,YAAY,EAAE,IAAI;gBAClB,aAAa,EAAE,IAAI;aACpB;SACF,EACD,iBAAiB,CAAC,SAAS,EAAE,mBAAmB,EAAE,iBAAiB,CAAC,CACrE,CAAC;QAEF,mBAAmB,CACjB,mBAAmB,EACnB,SAAS,SAAS,4BAA4B,CAC/C,CAAC;IACJ,CAAC,EACD;QACE,SAAS,EAAE,mBAAmB,SAAS,EAAE;QACzC,OAAO,EAAE,mBAAmB;QAC5B,SAAS,EAAE,gBAAgB,CAAC,oBAAoB;QAChD,QAAQ,EAAE,IAAI;KACf,CACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Barrel file for the `echo_message` tool.
|
|
3
|
-
* This file serves as the public interface for the echo tool module,
|
|
4
|
-
* primarily exporting the `registerEchoTool` function. This function is
|
|
5
|
-
* responsible for registering the echo tool with an MCP server instance,
|
|
6
|
-
* making it available for invocation by clients.
|
|
7
|
-
*
|
|
8
|
-
* Consuming modules should import from this barrel file to access
|
|
9
|
-
* the echo tool's registration capabilities.
|
|
10
|
-
* @module src/mcp-server/tools/echoTool/index
|
|
11
|
-
*/
|
|
12
|
-
export { registerEchoTool } from "./registration.js";
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/echoTool/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Barrel file for the `echo_message` tool.
|
|
3
|
-
* This file serves as the public interface for the echo tool module,
|
|
4
|
-
* primarily exporting the `registerEchoTool` function. This function is
|
|
5
|
-
* responsible for registering the echo tool with an MCP server instance,
|
|
6
|
-
* making it available for invocation by clients.
|
|
7
|
-
*
|
|
8
|
-
* Consuming modules should import from this barrel file to access
|
|
9
|
-
* the echo tool's registration capabilities.
|
|
10
|
-
* @module src/mcp-server/tools/echoTool/index
|
|
11
|
-
*/
|
|
12
|
-
export { registerEchoTool } from "./registration.js";
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/echoTool/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|