pylon_get_issue_body
Retrieve the full body content of an issue, including large email threads, with a configurable maximum length up to 10,000 characters.
Instructions
Get the full body content of an issue. Warning: can be very large for email threads.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The issue ID or issue number | |
| max_length | No | Maximum body length to return (default 2000, max 10000) |
Implementation Reference
- src/index.ts:654-679 (handler)The handler function for pylon_get_issue_body. It calls client.getIssue(id), extracts body_html from the raw response, strips HTML tags, truncates to max_length (default 2000, max 10000), and returns the body text.
async ({ id, max_length }) => { const result = await client.getIssue(id); const raw = result.data as unknown as Record<string, unknown>; const bodyHtml = raw['body_html'] as string | null | undefined; if (!bodyHtml) { return { content: [{ type: 'text', text: 'No body content available.' }], }; } // Strip HTML and truncate const maxLen = max_length ?? 2000; const text = bodyHtml.replace(/<[^>]*>/g, ' ').replace(/\s+/g, ' ').trim(); const truncated = text.length > maxLen ? `${text.slice(0, maxLen - 3)}...` : text; return { content: [ { type: 'text', text: `Issue #${raw['number']} body (${text.length} chars total, showing ${truncated.length}):\n\n${truncated}`, }, ], }; }, - src/index.ts:642-680 (registration)The registration of the pylon_get_issue_body tool via server.tool(), including its description 'Get the full body content of an issue. Warning: can be very large for email threads.' and Zod schema for parameters (id: string, max_length: optional number 100-10000).
server.tool( 'pylon_get_issue_body', 'Get the full body content of an issue. Warning: can be very large for email threads.', { id: z.string().describe('The issue ID or issue number'), max_length: z .number() .min(100) .max(10000) .optional() .describe('Maximum body length to return (default 2000, max 10000)'), }, async ({ id, max_length }) => { const result = await client.getIssue(id); const raw = result.data as unknown as Record<string, unknown>; const bodyHtml = raw['body_html'] as string | null | undefined; if (!bodyHtml) { return { content: [{ type: 'text', text: 'No body content available.' }], }; } // Strip HTML and truncate const maxLen = max_length ?? 2000; const text = bodyHtml.replace(/<[^>]*>/g, ' ').replace(/\s+/g, ' ').trim(); const truncated = text.length > maxLen ? `${text.slice(0, maxLen - 3)}...` : text; return { content: [ { type: 'text', text: `Issue #${raw['number']} body (${text.length} chars total, showing ${truncated.length}):\n\n${truncated}`, }, ], }; }, ); - src/index.ts:645-653 (schema)Input validation schema for pylon_get_issue_body: id is a required string, max_length is an optional number with min=100 and max=10000.
{ id: z.string().describe('The issue ID or issue number'), max_length: z .number() .min(100) .max(10000) .optional() .describe('Maximum body length to return (default 2000, max 10000)'), }, - src/pylon-client.ts:445-447 (helper)The PylonClient.getIssue() method called by the handler. Makes a GET request to /issues/{id} and returns the issue data.
async getIssue(id: string): Promise<SingleResponse<Issue>> { return this.request<SingleResponse<Issue>>('GET', `/issues/${id}`); }