UNPKG

frappe-mcp-server

Version:

Enhanced Model Context Protocol server for Frappe Framework with comprehensive API instructions and helper tools

294 lines (293 loc) 7.82 kB
/** * This file contains detailed instructions and examples for using the Frappe API * through the MCP server. It provides guidance on common operations and best practices. */ /** * Common Frappe DocTypes * * These are some of the standard DocTypes in Frappe that you might want to interact with: * * - User: User accounts in the system * - Role: User roles for permission management * - DocType: Metadata about document types * - DocField: Field definitions for DocTypes * - DocPerm: Permission rules for DocTypes * - Custom Field: Custom fields added to DocTypes * - Custom Script: Client-side scripts for DocTypes * - Server Script: Server-side scripts for automation * - Workflow: Workflow definitions * - Workflow State: States in a workflow * - Workflow Action: Actions that transition between workflow states */ export declare const COMMON_DOCTYPES: { SYSTEM: string[]; CORE: string[]; }; /** * Frappe API Usage Instructions * * This object contains detailed instructions for common Frappe operations. * Each instruction includes a description, example usage, and tips. */ export declare const FRAPPE_INSTRUCTIONS: { DOCUMENT_OPERATIONS: { CREATE: { description: string; usage: string; }; GET: { description: string; usage: string; }; UPDATE: { description: string; usage: string; }; DELETE: { description: string; usage: string; }; LIST: { description: string; usage: string; }; }; SCHEMA_OPERATIONS: { GET_DOCTYPE_SCHEMA: { description: string; usage: string; }; GET_FIELD_OPTIONS: { description: string; usage: string; }; FIND_DOCTYPE: { description: string; usage: string; }; }; ADVANCED_OPERATIONS: { WORKING_WITH_CHILD_TABLES: { description: string; usage: string; }; HANDLING_FILE_ATTACHMENTS: { description: string; usage: string; }; WORKING_WITH_WORKFLOWS: { description: string; usage: string; }; }; BEST_PRACTICES: { HANDLING_ERRORS: { description: string; usage: string; }; EFFICIENT_QUERYING: { description: string; usage: string; }; NAMING_CONVENTIONS: { description: string; usage: string; }; USER_FRIENDLY_DISPLAY_NAMES: { description: string; usage: string; }; }; }; /** * Helper function to get instructions for a specific operation */ export declare function getInstructions(category: string, operation: string): string; /** * Helper function to get a list of common DocTypes */ export declare function getCommonDocTypes(category: string): string[]; export declare const HELPER_TOOLS: ({ name: string; description: string; inputSchema: { type: string; properties: { search_term: { type: string; description: string; }; module: { type: string; description: string; }; is_table: { type: string; description: string; }; is_single: { type: string; description: string; }; is_custom: { type: string; description: string; }; limit: { type: string; description: string; }; doctype?: undefined; name?: undefined; filters?: undefined; category?: undefined; operation?: undefined; }; required: never[]; }; } | { name: string; description: string; inputSchema: { type: string; properties: { search_term?: undefined; module?: undefined; is_table?: undefined; is_single?: undefined; is_custom?: undefined; limit?: undefined; doctype?: undefined; name?: undefined; filters?: undefined; category?: undefined; operation?: undefined; }; required: never[]; }; } | { name: string; description: string; inputSchema: { type: string; properties: { module: { type: string; description: string; }; search_term?: undefined; is_table?: undefined; is_single?: undefined; is_custom?: undefined; limit?: undefined; doctype?: undefined; name?: undefined; filters?: undefined; category?: undefined; operation?: undefined; }; required: string[]; }; } | { name: string; description: string; inputSchema: { type: string; properties: { doctype: { type: string; description: string; }; search_term?: undefined; module?: undefined; is_table?: undefined; is_single?: undefined; is_custom?: undefined; limit?: undefined; name?: undefined; filters?: undefined; category?: undefined; operation?: undefined; }; required: string[]; }; } | { name: string; description: string; inputSchema: { type: string; properties: { doctype: { type: string; description: string; }; name: { type: string; description: string; }; search_term?: undefined; module?: undefined; is_table?: undefined; is_single?: undefined; is_custom?: undefined; limit?: undefined; filters?: undefined; category?: undefined; operation?: undefined; }; required: string[]; }; } | { name: string; description: string; inputSchema: { type: string; properties: { doctype: { type: string; description: string; }; filters: { type: string; description: string; additionalProperties: boolean; }; search_term?: undefined; module?: undefined; is_table?: undefined; is_single?: undefined; is_custom?: undefined; limit?: undefined; name?: undefined; category?: undefined; operation?: undefined; }; required: string[]; }; } | { name: string; description: string; inputSchema: { type: string; properties: { category: { type: string; description: string; }; operation: { type: string; description: string; }; search_term?: undefined; module?: undefined; is_table?: undefined; is_single?: undefined; is_custom?: undefined; limit?: undefined; doctype?: undefined; name?: undefined; filters?: undefined; }; required: string[]; }; })[];