dbx-mcp-server
Version:
A Model Context Protocol server for Dropbox integration with AI-powered PDF analysis, multi-directory indexing, and parallel processing
28 lines • 934 B
JavaScript
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
import { promptDefinitions, getPromptWithArgs } from './prompt-definitions.js';
export const handleListPrompts = async () => {
return {
prompts: promptDefinitions.map(prompt => ({
name: prompt.name,
description: prompt.description,
arguments: prompt.arguments
}))
};
};
export const handleGetPrompt = async (request) => {
const { name, arguments: args } = request.params;
try {
const prompt = getPromptWithArgs(name, args);
if (!prompt) {
throw new McpError(ErrorCode.InvalidParams, `Prompt not found: ${name}`);
}
return prompt;
}
catch (error) {
if (error instanceof Error) {
throw new McpError(ErrorCode.InvalidParams, error.message);
}
throw error;
}
};
//# sourceMappingURL=prompt-handler.js.map