@cardor/bills-sri
v2.0.1
Published
Bills SRI is a Node.js package designed to facilitate the management and automation of bill files, including listing, renaming, reading, moving, and copying bill files. It provides a set of tools and prompts for workflow automation, ideal for integration
Downloads
29
Maintainers
Readme
Bills SRI
Bills SRI is a Node.js package designed to facilitate the management and automation of bill files, including listing, renaming, reading, moving, and copying bill files. It provides a set of tools and prompts for workflow automation, ideal for integration with MCP (Model Context Protocol) servers.
Tools
1. list-bill-files
- Description: Lists files associated with a bill in a given folder.
- Input Schema:
{ "sourcePath": "string", // Path to the folder with bill files "targetPath": "string" // (Optional) Path where the listed files will be saved } - Output Schema:
or on error:{ "success": true, "error": null, "filesPath": ["string", ...] // Array of file paths found }{ "success": false, "error": "Error message", "filesPath": [] }
2. rename-bill-files
- Description: Renames files associated with a bill.
- Input Schema:
{ "filesData": [ { "oldPath": "string", // Current file path "newPath": "string" // New file path } ] } - Output Schema:
or on error:{ "success": true, "error": null, "filesData": [ { "oldPath": "string", "newPath": "string" } ] }{ "success": false, "error": "Error message", "filesData": [] }
3. read-bill-files
- Description: Reads and parses content from bill PDF files in a folder.
- Input Schema:
{ "sourcePath": "string" // Path to the folder with bill files } - Output Schema:
or on error:{ "success": true, "error": null, "files": [ { "content": "string", // Extracted text content from PDF "path": "string", // File path "name": "string" // File name } ] }{ "success": false, "error": "Error message", "files": [] }
4. move-bill-files
- Description: Moves files associated with a bill to a new location.
- Input Schema:
{ "filesData": [ { "oldPath": "string", // Current file path "newPath": "string" // New file path } ] } - Output Schema:
(Igual querename-bill-files)
5. copy-bill-files
- Description: Copies files associated with a bill to a new location.
- Input Schema:
(Igual quemove-bill-files) - Output Schema:
(Igual quemove-bill-files)
6. analyze-bill-files
- Description: Analyzes bill files and generates a prompt instruction based on guidelines.
- Input Schema:
{ "filesPath": ["string", ...], // Array of file paths to analyze "guidelinesPrompt": "string" // Text, path or URL to guidelines for analysis } - The
guidelinesPromptcan be a text string, a file path, or a URL pointing to the guidelines for analyzing the bill files. You can also set it via the environment variableBILLS_ANALYZE_GUIDELINES. Examples:- Text:
"Analyze the bill files based on the following guidelines..." - File path:
file:<absolute-path-to-guidelines> - URL:
http://example.com/guidelines.pdf,https://example.com/guidelines.txtorhttps://example.com/guidelines.md
- Text:
- Output Schema:
or on error:{ "success": true, "error": null, "promptInstruction": "string" // Generated prompt for further processing }{ "success": false, "error": "Error message", "promptInstruction": "" }
Prompts
1. rename-bill-files
- Description: Generates a prompt to rename bill files from a folder workflow.
- Args Schema:
GenerateRenameBillFilesPromptRaw - Input Example:
{ "sourcePath": "/path/to/bill/files" } - Output: Prompt instructing the workflow to:
- List all files and their content using
read-bill-files. - Analyze PDF content to determine BILL NUMBER.
- Rename files using
rename-bill-files, prefixing filenames with the BILL NUMBER.
- List all files and their content using
2. list-bill-files
- Description: Generates a prompt to list bill files from a folder workflow.
- Args Schema:
InputListBillFilesRaw - Input Example:
{ "sourcePath": "/path/to/bill/files" } - Output: Prompt instructing the workflow to list all files using
list-bill-filesand return file names in JSON format.
3. copy-move-bill-files
- Description: Generates a prompt to move or copy bill files from a folder workflow.
- Args Schema:
CopyAndMoveBillFilesRaw - Input Example:
{ "sourcePath": "/path/to/bill/files", "action": "copy" } - Output: Prompt instructing the workflow to list files and move/copy them to a new location using the appropriate tool.
Usage
Command (NPM)
- Install dependencies:
pnpm install -g @cardor/bills-sri - Add the configuration to your MCP client:
"bills-sri": { "type": "stdio", "command": "cardor-bills-sri", "env": { // Could be a text, file path or URL "BILLS_ANALYZE_GUIDELINES": "file://path/to/guidelines" } }
Command (With Docker)
- Clone the repository:
git clone <repository-url> - Build the Docker image:
pnpm run docker:build - Add the configuration to your MCP client:
"bills-sri-dock": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "BILLS_ANALYZE_GUIDELINES=file://path/to/guidelines", "bills-sri" ] }
Stream HTTP requests
- Clone the repository:
git clone <repository-url> - Install dependencies:
pnpm install - Build the MCP:
pnpm run build - Start the MCP:
pnpm run start - Use the MCP server at
http://localhost:5555/mcp
Example: Using a Tool via HTTP
POST /mcp/tool/list-bill-files
{
"sourcePath": "/Users/jolyne/Downloads/BillsSource",
"targetPath": "/Users/jolyne/Downloads/BillsTarget"
}POST /mcp/prompt/rename-bill-files
{
"sourcePath": "/Users/jolyne/Downloads/BillsSource"
}Schemas
InputListBillFilesRaw:{ "sourcePath": "string", "targetPath": "string" }InputRenameBillFilesRaw:{ "filesData": [{ "oldPath": "string", "newPath": "string" }] }GenerateRenameBillFilesPromptRaw:{ "sourcePath": "string" }CopyAndMoveBillFilesRaw:{ "sourcePath": "string", "action": "copy" // "move" }
