Skip to main content
Glama
IMPLEMENTATION.md3.52 kB
# Implementation Guide: Generic Jira GET Tool This document provides detailed implementation guidance for the Generic Jira GET Tool. It outlines the specific files to create, their content structure, and integration points with the existing codebase. ## Directory Structure Based on the existing pattern, the implementation will include: ``` src/tools/jira/jiraGet/ ├── __tests__/ # Tests for the tool ├── utils/ # Utility functions │ ├── toolDefinitions.ts # Tool schema definition │ └── toolExecutor.ts # Execution logic └── jiraGetTool.ts # Main export file ``` ## Implementation Files ### 1. Tool Definition (`utils/toolDefinitions.ts`) This file will define the tool schema according to MCP SDK standards, including: - Tool name: `jiraGet` - Description: Clear explanation of the tool's purpose - Input schema: Definition of required and optional parameters - `endpoint`: Required string for the API endpoint path - `queryParams`: Optional object for query parameters ### 2. Tool Executor (`utils/toolExecutor.ts`) This file will contain the execution logic: - Parameter validation functions - Query parameter handling - Endpoint construction with proper URL encoding - Integration with the existing `callJiraApi` utility - Error handling according to the project's "errors as objects" pattern - Formatting of results to match the expected `ToolResult` interface ### 3. Main Export (`jiraGetTool.ts`) This file will serve as the main entry point, combining the tool definition and executor: - Import and re-export the tool definition - Create and export the configured executor function - Add any necessary documentation or metadata ### 4. Integration with Tool Registry Update the main tool registry in `src/tools/index.ts` to: - Import the new tool and executor - Register them in the `initializeRegistry` function ### 5. Tests (`__tests__/jiraGetTool.test.ts`) Create comprehensive tests that verify: - Parameter validation - URL construction with various query parameters - Error handling for invalid inputs - Integration with the API calling mechanism - Response formatting ## Key Implementation Considerations ### Parameter Handling The query parameters should support: - Simple key-value pairs - Arrays (formatted according to Jira API expectations) - Nested objects (properly serialized) - URL encoding to handle special characters ### Error Handling Follow the existing pattern with: - Validation errors for missing or invalid parameters - API errors wrapped in the standard format - Logging for debugging purposes ### Security Considerations - Ensure the tool only performs GET requests - Validate endpoints to prevent unexpected behavior - Sanitize inputs to avoid injection attacks ## Integration Testing After implementation, perform integration testing to ensure: - The tool can access various Jira endpoints - Results are properly formatted and accessible - Error scenarios are handled gracefully - The tool functions within the overall application context ## Documentation Aside from code comments, update: - The project's main documentation to include the new tool - Usage examples to demonstrate common scenarios - Any relevant architecture diagrams ## Future Extensions Consider potential extensions: - Support for pagination of large result sets - Caching frequently requested data - Specialized parameter handling for common endpoints

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tbreeding/jira-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server