dbx-mcp-server
Version:
A Model Context Protocol server for Dropbox integration with AI-powered PDF analysis, multi-directory indexing, and parallel processing
549 lines • 19.8 kB
JavaScript
const toolDefinitions = [
{
name: 'list_files',
description: 'List files in a folder (integrates with Dropbox)',
inputSchema: {
type: 'object',
properties: {
path: {
type: 'string',
description: 'Path to the folder (default: root)',
default: '',
},
},
},
},
{
name: 'upload_file',
description: 'Upload a file (integrates with Dropbox)',
inputSchema: {
type: 'object',
properties: {
path: {
type: 'string',
description: 'Path to upload the file to',
},
content: {
type: 'string',
description: 'File content (base64 encoded)',
},
},
required: ['path', 'content'],
},
},
{
name: 'download_file',
description: 'Download a file to local disk and return the file path. Files are saved to the "downloads" directory. (Integrates with Dropbox)',
inputSchema: {
type: 'object',
properties: {
path: {
type: 'string',
description: 'Path to the file to download from Dropbox',
},
},
required: ['path'],
},
},
{
name: 'safe_delete_item',
description: 'Safely delete a file or folder with recycle bin support, confirmation, and audit logging',
inputSchema: {
type: 'object',
properties: {
path: {
type: 'string',
description: 'Path to the file or folder to delete',
},
userId: {
type: 'string',
description: 'User ID for tracking and rate limiting',
},
skipConfirmation: {
type: 'boolean',
description: 'Skip deletion confirmation (default: false)',
default: false,
},
retentionDays: {
type: 'number',
description: 'Number of days to keep in recycle bin (default: from config)',
},
reason: {
type: 'string',
description: 'Reason for deletion (for audit logs)',
},
permanent: {
type: 'boolean',
description: 'Permanently delete instead of moving to recycle bin (default: false)',
default: false,
}
},
required: ['path', 'userId'],
},
},
{
name: 'delete_item',
description: 'Legacy delete operation (deprecated, use safe_delete_item instead)',
inputSchema: {
type: 'object',
properties: {
path: {
type: 'string',
description: 'Path to the file or folder to delete',
},
},
required: ['path'],
},
},
{
name: 'create_folder',
description: 'Create a new folder (integrates with Dropbox)',
inputSchema: {
type: 'object',
properties: {
path: {
type: 'string',
description: 'Path where the folder should be created (e.g., "/New Folder")',
},
},
required: ['path'],
},
},
{
name: 'copy_item',
description: 'Copy a file or folder to a new location',
inputSchema: {
type: 'object',
properties: {
from_path: {
type: 'string',
description: 'Path of the source file or folder',
},
to_path: {
type: 'string',
description: 'Path for the destination file or folder',
},
},
required: ['from_path', 'to_path'],
},
},
{
name: 'move_item',
description: 'Move or rename a file or folder',
inputSchema: {
type: 'object',
properties: {
from_path: {
type: 'string',
description: 'Path of the source file or folder',
},
to_path: {
type: 'string',
description: 'New path for the file or folder',
},
},
required: ['from_path', 'to_path'],
},
},
{
name: 'get_file_metadata',
description: 'Get metadata for a file or folder',
inputSchema: {
type: 'object',
properties: {
path: {
type: 'string',
description: 'Path to the file or folder',
},
},
required: ['path'],
},
},
{
name: 'search_file_db',
description: 'Advanced search for files and folders with filtering capabilities (integrates with Dropbox)',
inputSchema: {
type: 'object',
properties: {
query: {
type: 'string',
description: 'Search query string',
},
path: {
type: 'string',
description: 'Path to search within (defaults to root)',
default: '',
},
max_results: {
type: 'number',
description: 'Maximum number of results to return (1-1000)',
default: 20,
},
file_extensions: {
type: 'array',
items: {
type: 'string'
},
description: 'Filter by file extensions (e.g., ["pdf", "doc", "txt"])',
},
file_categories: {
type: 'array',
items: {
type: 'string',
enum: ['image', 'document', 'pdf', 'spreadsheet', 'presentation', 'audio', 'video', 'folder']
},
description: 'Filter by file categories',
},
date_range: {
type: 'object',
properties: {
start: {
type: 'string',
description: 'Start date in ISO format (e.g., "2024-01-01")',
},
end: {
type: 'string',
description: 'End date in ISO format (e.g., "2024-12-31")',
}
}
},
include_content_match: {
type: 'boolean',
description: 'Search within file contents (may be slower)',
default: false
},
sort_by: {
type: 'string',
enum: ['relevance', 'last_modified_time', 'file_size'],
description: 'Sort results by specified criteria',
default: 'relevance'
},
order: {
type: 'string',
enum: ['asc', 'desc'],
description: 'Sort order (ascending or descending)',
default: 'desc'
}
},
required: ['query'],
},
},
{
name: 'get_sharing_link',
description: 'Create a shared link for a file or folder',
inputSchema: {
type: 'object',
properties: {
path: {
type: 'string',
description: 'Path to the file or folder to share',
},
},
required: ['path'],
},
},
{
name: 'get_account_info',
description: 'Get information about the connected account (integrates with Dropbox)',
inputSchema: {
type: 'object',
properties: {},
},
},
{
name: 'get_file_content',
description: 'Get the content of a file (integrates with Dropbox)',
inputSchema: {
type: 'object',
properties: {
path: {
type: 'string',
description: 'Path to the file in Dropbox',
},
},
required: ['path'],
},
},
{
name: 'dropbox_analyze_pdf',
description: 'Analyze PDF files from Dropbox using Gemini 2.5 Flash AI model with custom prompts',
inputSchema: {
type: 'object',
properties: {
path: {
type: 'string',
description: 'Dropbox path to the PDF file (e.g., "/documents/invoice.pdf")',
},
prompt: {
type: 'string',
description: 'Analysis instructions or questions about the PDF content',
},
useThinking: {
type: 'boolean',
description: 'Use Gemini thinking mode for complex analysis (optional)',
default: false,
},
maxReasoningTokens: {
type: 'number',
description: 'Maximum tokens for reasoning in thinking mode (default: 5000)',
default: 5000,
},
},
required: ['path', 'prompt'],
},
},
{
name: 'dropbox_index_file',
description: 'Index a single PDF file with AI analysis for structured document management',
inputSchema: {
type: 'object',
properties: {
path: {
type: 'string',
description: 'Dropbox path to the PDF file to index (e.g., "/documents/contract.pdf")',
},
},
required: ['path'],
},
},
{
name: 'dropbox_index_folder',
description: 'Recursively index PDF files in one or multiple Dropbox folders with AI analysis. Supports targeted directory indexing and exclusion patterns.',
inputSchema: {
type: 'object',
properties: {
path: {
type: 'string',
description: 'Single Dropbox path to index (e.g., "/documents"). Use this OR paths parameter.',
},
paths: {
type: 'array',
items: { type: 'string' },
description: 'Multiple Dropbox paths to index (e.g., ["/contracts", "/invoices", "/reports"]). Use this OR path parameter.',
},
recursive: {
type: 'boolean',
description: 'Whether to search subfolders recursively (default: true)',
default: true,
},
batchSize: {
type: 'number',
description: 'Number of files to process in parallel with ultra-high-concurrency AI analysis and optimized SQLite batching (default: 200, range: 50-300 recommended)',
default: 200,
minimum: 50,
maximum: 300,
},
excludePaths: {
type: 'array',
items: { type: 'string' },
description: 'Specific paths to exclude from indexing (e.g., ["/documents/private", "/temp"])',
},
excludePatterns: {
type: 'array',
items: { type: 'string' },
description: 'Glob patterns to exclude (e.g., ["*/backup/*", "*/.git/*", "*/draft/*"])',
},
respectGlobalExclusions: {
type: 'boolean',
description: 'Whether to apply global exclusion rules from config (default: true)',
default: true,
},
scopeToDirectories: {
type: 'boolean',
description: 'When true, only index files within the specified directories and apply global exclusions only within scope (default: false)',
default: false,
},
},
},
},
{
name: 'dropbox_search_indexed',
description: 'Search indexed documents by content, type, or metadata',
inputSchema: {
type: 'object',
properties: {
query: {
type: 'string',
description: 'Search query (searches file names and document synopses)',
},
docType: {
type: 'string',
enum: ['contract', 'invoice', 'proposal', 'report'],
description: 'Filter by document type (optional)',
},
limit: {
type: 'number',
description: 'Maximum number of results to return (default: 20)',
default: 20,
},
},
required: ['query'],
},
},
{
name: 'dropbox_document_stats',
description: 'Get statistics and business intelligence from indexed documents',
inputSchema: {
type: 'object',
properties: {},
},
},
{
name: 'dropbox_team_info',
description: 'Get Dropbox Business team configuration and detect team space support for accessing team folders like /Surge',
inputSchema: {
type: 'object',
properties: {},
},
},
// Schema management tools
{
name: 'get_schema_config',
description: 'View current schema configuration including document types, fields, and prompts',
inputSchema: {
type: 'object',
properties: {
documentType: {
type: 'string',
description: 'Optional: Get configuration for specific document type only',
},
},
},
},
{
name: 'update_document_type',
description: 'Update an existing document type configuration including fields and prompts',
inputSchema: {
type: 'object',
properties: {
typeName: {
type: 'string',
description: 'Name of the document type to update',
},
description: {
type: 'string',
description: 'Updated description for the document type',
},
enabled: {
type: 'boolean',
description: 'Whether the document type is enabled',
},
fields: {
type: 'object',
description: 'Field definitions for the document type',
},
prompt: {
type: 'object',
description: 'Prompt configuration for the document type',
properties: {
extraction: {
type: 'string',
description: 'Extraction instructions for this document type',
},
guidelines: {
type: 'array',
items: { type: 'string' },
description: 'Type-specific guidelines',
},
},
},
},
required: ['typeName'],
},
},
{
name: 'add_document_type',
description: 'Add a new custom document type with fields and prompts',
inputSchema: {
type: 'object',
properties: {
name: {
type: 'string',
description: 'Name of the new document type',
},
description: {
type: 'string',
description: 'Description of what this document type represents',
},
enabled: {
type: 'boolean',
description: 'Whether the document type is enabled',
default: true,
},
fields: {
type: 'object',
description: 'Field definitions with type, description, and constraints',
},
prompt: {
type: 'object',
description: 'Prompt configuration for this document type',
properties: {
extraction: {
type: 'string',
description: 'Extraction instructions for this document type',
},
guidelines: {
type: 'array',
items: { type: 'string' },
description: 'Type-specific guidelines',
},
},
},
},
required: ['name', 'description', 'fields'],
},
},
{
name: 'remove_document_type',
description: 'Remove a document type from the schema configuration',
inputSchema: {
type: 'object',
properties: {
typeName: {
type: 'string',
description: 'Name of the document type to remove',
},
confirm: {
type: 'boolean',
description: 'Confirmation that you want to remove this document type',
default: false,
},
},
required: ['typeName', 'confirm'],
},
},
{
name: 'update_global_prompt',
description: 'Update the global prompt configuration used for all document analysis',
inputSchema: {
type: 'object',
properties: {
basePrompt: {
type: 'string',
description: 'Base prompt for document analysis',
},
classification: {
type: 'string',
description: 'Classification instruction text',
},
guidelines: {
type: 'array',
items: { type: 'string' },
description: 'Global guidelines applied to all document types',
},
},
},
},
{
name: 'test_schema_prompt',
description: 'Generate and preview the current analysis prompt without analyzing a document',
inputSchema: {
type: 'object',
properties: {},
},
},
];
// Note: This project is not affiliated with, endorsed by, or sponsored by Dropbox.
// It is an independent integration that works with Dropbox's public API.
export { toolDefinitions };
//# sourceMappingURL=tool-definitions.js.map