pylon_get_issue
Get issue details by ID or number, returning standard fields. Optionally include a truncated body preview of the issue content.
Instructions
Get issue details by ID or number. Returns standard fields (no body). Use pylon_get_issue_body to fetch body content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The issue ID or issue number | |
| include_body | No | Include truncated body preview (500 chars max) |
Implementation Reference
- src/index.ts:614-639 (handler)The main tool handler for 'pylon_get_issue'. Calls client.getIssue(id), then transforms the raw response using toIssueStandard (default) or toIssueFull (if include_body is true). Returns JSON-formatted issue details.
server.tool( 'pylon_get_issue', 'Get issue details by ID or number. Returns standard fields (no body). Use pylon_get_issue_body to fetch body content.', { id: z.string().describe('The issue ID or issue number'), include_body: z .boolean() .optional() .describe('Include truncated body preview (500 chars max)'), }, async ({ id, include_body }) => { const result = await client.getIssue(id); const raw = result.data as unknown as Record<string, unknown>; if (include_body) { const issue = toIssueFull(raw); return { content: [{ type: 'text', text: JSON.stringify(issue, null, 2) }], }; } const issue = toIssueStandard(raw); return { content: [{ type: 'text', text: JSON.stringify(issue, null, 2) }], }; }, - src/schemas.ts:47-64 (schema)IssueStandardSchema used for default pylon_get_issue output - extends IssueMinimalSchema with requester_id, team_id, resolution_time, etc. IssueFullSchema adds body_html.
export const IssueStandardSchema = IssueMinimalSchema.extend({ requester_id: z.string().nullable().optional(), team_id: z.string().nullable().optional(), resolution_time: z.string().nullable().optional(), latest_message_time: z.string().nullable().optional(), first_response_time: z.string().nullable().optional(), customer_portal_visible: z.boolean().optional(), source: z.string().optional(), type: z.string().optional(), }); /** * Full issue including body - only used when explicitly requested. * The body_html is truncated to prevent context overflow. */ export const IssueFullSchema = IssueStandardSchema.extend({ body_html: z.string().nullable().optional(), }); - src/schemas.ts:241-253 (helper)toIssueStandard() - transforms raw API response to IssueStandard format (no body). Called by the handler when include_body is false.
export function toIssueStandard(raw: Record<string, unknown>): IssueStandard { return { ...toIssueMinimal(raw), requester_id: extractRequesterId(raw), team_id: extractTeamId(raw), resolution_time: raw['resolution_time'] as string | null | undefined, latest_message_time: raw['latest_message_time'] as string | null | undefined, first_response_time: raw['first_response_time'] as string | null | undefined, customer_portal_visible: raw['customer_portal_visible'] as boolean | undefined, source: raw['source'] as string | undefined, type: raw['type'] as string | undefined, }; } - src/schemas.ts:258-266 (helper)toIssueFull() - transforms raw API response to IssueFull format with truncated body_html (500 chars). Called by the handler when include_body is true.
export function toIssueFull(raw: Record<string, unknown>): IssueFull { return { ...toIssueStandard(raw), body_html: stripHtmlAndTruncate( raw['body_html'] as string | null | undefined, MAX_BODY_LENGTH, ), }; } - src/index.ts:614-640 (registration)Registration of the 'pylon_get_issue' tool via server.tool() with name, description, zod schema params (id: string, include_body: optional boolean), and handler function.
server.tool( 'pylon_get_issue', 'Get issue details by ID or number. Returns standard fields (no body). Use pylon_get_issue_body to fetch body content.', { id: z.string().describe('The issue ID or issue number'), include_body: z .boolean() .optional() .describe('Include truncated body preview (500 chars max)'), }, async ({ id, include_body }) => { const result = await client.getIssue(id); const raw = result.data as unknown as Record<string, unknown>; if (include_body) { const issue = toIssueFull(raw); return { content: [{ type: 'text', text: JSON.stringify(issue, null, 2) }], }; } const issue = toIssueStandard(raw); return { content: [{ type: 'text', text: JSON.stringify(issue, null, 2) }], }; }, );