@vint.tri/report_gen_mcp 1.1.3 → 1.1.4
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/dist/index.js +20 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -97,7 +97,7 @@ if (process.argv.length === 2) {
|
|
|
97
97
|
// No command specified, run in stdio mode using MCP SDK
|
|
98
98
|
const mcpServer = new McpServer({
|
|
99
99
|
name: "report_gen_mcp",
|
|
100
|
-
version: "1.1.
|
|
100
|
+
version: "1.1.3",
|
|
101
101
|
}, {
|
|
102
102
|
// Disable health check to prevent automatic calls
|
|
103
103
|
capabilities: {
|
|
@@ -193,9 +193,9 @@ if (process.argv.length === 2) {
|
|
|
193
193
|
throw error;
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
|
-
// Register a
|
|
197
|
-
mcpServer.registerTool("get-report
|
|
198
|
-
description: "Get
|
|
196
|
+
// Register a unified tool that combines all functionality
|
|
197
|
+
mcpServer.registerTool("get-report", {
|
|
198
|
+
description: "Get comprehensive information about a generated report file including path, URL, Russian title, and file content for direct download",
|
|
199
199
|
inputSchema: {
|
|
200
200
|
filePath: z.string().describe("Full path to the report file")
|
|
201
201
|
},
|
|
@@ -208,23 +208,34 @@ if (process.argv.length === 2) {
|
|
|
208
208
|
const fileUrl = pathToFileURL(filePath).href;
|
|
209
209
|
// Read the file content
|
|
210
210
|
const fileContent = await fs.readFile(filePath, 'utf8');
|
|
211
|
+
// Generate a Russian title based on the filename
|
|
212
|
+
const fileName = path.basename(filePath, '.html');
|
|
213
|
+
const russianTitle = fileName.replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase());
|
|
214
|
+
// Get file stats
|
|
215
|
+
const fileStats = await fs.stat(filePath);
|
|
211
216
|
return {
|
|
212
217
|
content: [
|
|
213
218
|
{
|
|
214
219
|
type: "text",
|
|
215
220
|
text: JSON.stringify({
|
|
216
221
|
success: true,
|
|
217
|
-
|
|
218
|
-
message: "Click the URL to open the report",
|
|
222
|
+
message: "Полная информация о файле отчета получена успешно",
|
|
219
223
|
filePath: filePath,
|
|
220
|
-
|
|
221
|
-
|
|
224
|
+
fileUrl: fileUrl,
|
|
225
|
+
russianTitle: russianTitle,
|
|
226
|
+
fileContent: fileContent,
|
|
227
|
+
fileStats: {
|
|
228
|
+
size: fileStats.size,
|
|
229
|
+
created: fileStats.birthtime,
|
|
230
|
+
modified: fileStats.mtime
|
|
231
|
+
}
|
|
232
|
+
}, null, 2)
|
|
222
233
|
}
|
|
223
234
|
]
|
|
224
235
|
};
|
|
225
236
|
}
|
|
226
237
|
catch (error) {
|
|
227
|
-
throw new Error(
|
|
238
|
+
throw new Error(`Файл не найден: ${filePath}`);
|
|
228
239
|
}
|
|
229
240
|
});
|
|
230
241
|
async function main() {
|