Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { z } from 'zod';
import { callToolByNameAsync, callToolByNameRawAsync, createMockApiClient } from '../test-utils/mock-api-client';
import { ColumnType } from '../../../../monday-graphql/generated/graphql/graphql';
import { ZodTypeAny } from 'zod';
import { FullBoardDataToolSchema } from './full-board-data-tool';
import { FullBoardDataTool, FullBoardDataToolSchema } from './full-board-data-tool';
import { MondayAgentToolkit } from 'src/mcp/toolkit';

export type inputType = z.objectInputType<FullBoardDataToolSchema, ZodTypeAny>;
Expand All @@ -16,6 +16,14 @@ describe('Full Board Data Tool', () => {
jest.spyOn(MondayAgentToolkit.prototype as any, 'createApiClient').mockReturnValue(mocks.mockApiClient);
});

it('describes when to use the tool without an internal-use warning', () => {
const tool = new FullBoardDataTool(mocks.mockApiClient);

expect(tool.getDescription()).toContain('complete board data');
expect(tool.getDescription()).toContain('Prefer narrower board tools');
expect(tool.getDescription()).not.toContain('INTERNAL USE ONLY');
});

const mockBoardResponse = {
boards: [
{
Expand Down Expand Up @@ -298,7 +306,9 @@ describe('Full Board Data Tool', () => {
};

const result = await callToolByNameRawAsync('get_full_board_data', args);
expect(result.content[0].text).toContain('Failed to get full board data: Invalid board ID, Insufficient permissions');
expect(result.content[0].text).toContain(
'Failed to get full board data: Invalid board ID, Insufficient permissions',
);
});

it('Extracts user IDs from people column values', async () => {
Expand Down Expand Up @@ -364,5 +374,4 @@ describe('Full Board Data Tool', () => {
expect(userIdsCall).toContain('user789');
expect(userIdsCall).not.toContain('team456');
});

});
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class FullBoardDataTool extends BaseMondayApiTool<typeof fullBoardDataToo
});

getDescription(): string {
return `INTERNAL USE ONLY - DO NOT CALL THIS TOOL DIRECTLY. This tool is exclusively triggered by UI components and should never be invoked directly by the agent.`;
return `Fetch complete board data for UI-driven workflows that need items, updates, replies, people values, and user details in one response. Prefer narrower board tools for conversational requests that do not need the full board payload.`;
}

getInputSchema(): typeof fullBoardDataToolSchema {
Expand Down Expand Up @@ -152,7 +152,7 @@ export class FullBoardDataTool extends BaseMondayApiTool<typeof fullBoardDataToo
};

return {
content: result
content: result,
};
} catch (error) {
rethrowWithContext(error, 'get full board data');
Expand Down