UNPKG

@aashari/mcp-server-atlassian-jira

Version:

Node.js/TypeScript MCP server for Atlassian Jira. Equips AI systems (LLMs) with tools to list/get projects, search/get issues (using JQL/ID), and view dev info (commits, PRs). Connects AI capabilities directly into Jira project management and issue tracki

86 lines (85 loc) 3.65 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeleteApiToolArgs = exports.PatchApiToolArgs = exports.PutApiToolArgs = exports.PostApiToolArgs = exports.RequestWithBodyArgs = exports.GetApiToolArgs = exports.OutputFormat = void 0; const zod_1 = require("zod"); /** * Output format options for API responses * - toon: Token-Oriented Object Notation (default, more token-efficient for LLMs) * - json: Standard JSON format */ exports.OutputFormat = zod_1.z .enum(['toon', 'json']) .optional() .describe('Output format: "toon" (default, 30-60% fewer tokens) or "json". TOON is optimized for LLMs with tabular arrays and minimal syntax.'); /** * Base schema fields shared by all API tool arguments * Contains path, queryParams, jq filter, and outputFormat */ const BaseApiToolArgs = { /** * The API endpoint path (without base URL) * Examples: * - "/rest/api/3/project" - list projects * - "/rest/api/3/project/{projectIdOrKey}" - get project * - "/rest/api/3/search/jql" - search issues with JQL (NOTE: /rest/api/3/search is deprecated) * - "/rest/api/3/issue/{issueIdOrKey}" - get issue * - "/rest/api/3/issue" - create issue */ path: zod_1.z .string() .min(1, 'Path is required') .describe('The Jira API endpoint path (without base URL). Must start with "/". Examples: "/rest/api/3/project", "/rest/api/3/search/jql", "/rest/api/3/issue/{issueIdOrKey}"'), /** * Optional query parameters as key-value pairs */ queryParams: zod_1.z .record(zod_1.z.string(), zod_1.z.string()) .optional() .describe('Optional query parameters as key-value pairs. Examples: {"maxResults": "50", "startAt": "0", "jql": "project=PROJ", "fields": "summary,status"}'), /** * Optional JMESPath expression to filter/transform the response * IMPORTANT: Always use this to reduce response size and token costs */ jq: zod_1.z .string() .optional() .describe('JMESPath expression to filter/transform the response. IMPORTANT: Always use this to extract only needed fields and reduce token costs. Examples: "issues[*].{key: key, summary: fields.summary}" (extract specific fields), "issues[0]" (first result), "issues[*].key" (keys only). See https://jmespath.org'), /** * Output format for the response * Defaults to TOON (token-efficient), can be set to JSON if needed */ outputFormat: exports.OutputFormat, }; /** * Body field for requests that include a request body (POST, PUT, PATCH) */ const bodyField = zod_1.z .record(zod_1.z.string(), zod_1.z.unknown()) .describe('Request body as a JSON object. Structure depends on the endpoint. Example for issue: {"fields": {"project": {"key": "PROJ"}, "summary": "Issue title", "issuetype": {"name": "Task"}}}'); /** * Schema for jira_get tool arguments (GET requests - no body) */ exports.GetApiToolArgs = zod_1.z.object(BaseApiToolArgs); /** * Schema for requests with body (POST, PUT, PATCH) */ exports.RequestWithBodyArgs = zod_1.z.object({ ...BaseApiToolArgs, body: bodyField, }); /** * Schema for jira_post tool arguments (POST requests) */ exports.PostApiToolArgs = exports.RequestWithBodyArgs; /** * Schema for jira_put tool arguments (PUT requests) */ exports.PutApiToolArgs = exports.RequestWithBodyArgs; /** * Schema for jira_patch tool arguments (PATCH requests) */ exports.PatchApiToolArgs = exports.RequestWithBodyArgs; /** * Schema for jira_delete tool arguments (DELETE requests - no body) */ exports.DeleteApiToolArgs = exports.GetApiToolArgs;