Skip to content

Commit a2d815f

Browse files
committed
refactor: append pagination to tool content instead of metadata
1 parent 5552227 commit a2d815f

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

src/tools/atlassian.issues.tool.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
GetIssueToolArgsType,
99
} from './atlassian.issues.types.js';
1010
import atlassianIssuesController from '../controllers/atlassian.issues.controller.js';
11+
import { formatPagination } from '../utils/formatter.util.js';
1112

1213
// Create a contextualized logger for this file
1314
const toolLogger = Logger.forContext('tools/atlassian.issues.tool.ts');
@@ -53,15 +54,20 @@ async function listIssues(args: ListIssuesToolArgsType) {
5354
total: result.pagination?.total,
5455
});
5556

57+
let finalText = result.content;
58+
if (result.pagination) {
59+
finalText += '\n\n' + formatPagination(result.pagination);
60+
}
61+
5662
return {
5763
content: [
5864
{
5965
type: 'text' as const,
60-
text: result.content,
66+
text: finalText,
6167
},
6268
],
6369
metadata: {
64-
pagination: result.pagination,
70+
// pagination: result.pagination, // Removed
6571
},
6672
};
6773
} catch (error) {

src/tools/atlassian.projects.tool.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
} from './atlassian.projects.types.js';
1010

1111
import atlassianProjectsController from '../controllers/atlassian.projects.controller.js';
12+
import { formatPagination } from '../utils/formatter.util.js';
1213

1314
// Create a contextualized logger for this file
1415
const toolLogger = Logger.forContext('tools/atlassian.projects.tool.ts');
@@ -51,15 +52,20 @@ async function listProjects(args: ListProjectsToolArgsType) {
5152
total: result.pagination?.total,
5253
});
5354

55+
let finalText = result.content;
56+
if (result.pagination) {
57+
finalText += '\n\n' + formatPagination(result.pagination);
58+
}
59+
5460
return {
5561
content: [
5662
{
5763
type: 'text' as const,
58-
text: result.content,
64+
text: finalText,
5965
},
6066
],
6167
metadata: {
62-
pagination: result.pagination,
68+
// pagination: result.pagination, // Removed
6369
},
6470
};
6571
} catch (error) {

0 commit comments

Comments
 (0)