feat(search-tool): align search filters and returned fields with GQL schema - #455
Open
tjackowiak wants to merge 3 commits into
Open
feat(search-tool): align search filters and returned fields with GQL schema#455tjackowiak wants to merge 3 commits into
tjackowiak wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
damianmarek
approved these changes
Aug 11, 2026
…coverage Follow-up review of the previous commit surfaced several defects: - timelineItemType was hand-written as a 5-value z.enum, but the GQL TimelineItemKind enum has 23 values. The tool silently rejected valid values such as `note`, `phoneCall` and `meeting`. Both timelineItemType and timelineProductKind now derive from the generated enums via z.nativeEnum, so the accepted set cannot drift from the schema. - workspaceKind was narrowed to z.enum(['open','closed']) based on the argument's description, but WorkspaceKind carries a third value (`template`) and the search argument is a plain String in the schema. It is now z.string() with the known values documented instead. - overviewKinds keeps its pass-through typing: search.overviews(kinds:) is [String!] and the casing differs between layers (the DashboardKind enum is uppercase while the search index documents lowercase), so narrowing it would be a guess. Comments record the reasoning at both sites. - The generated GraphQL types were previously hand-edited, which left the embedded Document ASTs describing the old queries and would have been overwritten by the next codegen run. They are now produced by `yarn codegen` against both schemas, which also validated every new argument and field name. - The DASHBOARDS branch bypassed toFilterIds, so an empty creatorIds or overviewKinds array was forwarded as `[]` rather than normalized to "no filter" as every other search type does. - getDescription() did not mention the fields BOARD and WORKSPACES now return, so callers could not discover them. search-tool.test.ts no longer compiled after the response types gained required fields; its fixtures are repaired and 26 tests added covering the new filters, the new returned fields, the enum validation boundaries and the empty-array normalization. Full suite: 1382 passing. Build and lint clean.
…gql-parity # Conflicts: # packages/agent-toolkit/src/core/tools/platform-api-tools/search-tool/search-tool.graphql.ts # packages/agent-toolkit/src/core/tools/platform-api-tools/search-tool/search-tool.test.ts # packages/agent-toolkit/src/core/tools/platform-api-tools/search-tool/search-tool.ts # packages/agent-toolkit/src/monday-graphql/generated/graphql/gql.ts # packages/agent-toolkit/src/monday-graphql/generated/graphql/graphql.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Aligns
search-toolMCP parameters and returned fields with the current GQL schema (stable + dev). Several filters available in the API were not exposed, and someindexed_datafields were not returned.New input parameters
dateRange(created_before/after, updated_before/after)boardIdsworkspaceIdsitemIdsworkspaceKindtimelineItemTypetimelineProductKindoverviewKindsNew returned fields
description,creatorIdcreatedAt,updatedAtkind,statetype,productKind,createdAt,updatedAtkind,state,createdBy,createdAt,updatedAtNotes on typing choices
The two kinds of "kind" arguments are deliberately modelled differently, following one rule: a GQL enum becomes
z.nativeEnum; a GQLStringstaysz.string()with the known values documented.timelineItemType/timelineProductKindare backed by the realTimelineItemKind/TimelineItemProductKindenums, so they usez.nativeEnumon the generated enums.TimelineItemKindhas 23 values — hand-listing them would drift from the schema as new kinds are added.workspaceKindisz.string().search.workspaces(kind:)is a plainString, andWorkspaceKinditself carries a third value (template) beyond the two named in the argument's description, so narrowing would reject valid input.overviewKindsisz.array(z.string()).search.overviews(kinds:)is[String!]and the casing is inconsistent across layers — theDashboardKindenum is uppercase while the search index documents lowercase — so the values are passed through rather than guessed.dateRangeis intentionally not validated with.datetime(): the API accepts date-only strings that a strict ISO8601-with-time check would reject. The expected format is documented in the field descriptions instead.strategy(SPEED/BALANCED/QUALITY) is out of scope for this PR — it trades search quality against latency and needs a separate decision on defaults before being exposed.Generated types were produced by
yarn codegenagainst both schemas, which also validated every new argument and field name. No manual edits to generated files.Test plan
yarn test— 1382 passing (152 insearch-tool.test.ts).yarn buildandyarn lintclean.Existing fixtures were repaired where the response types gained required fields, and 26 tests were added covering:
timelineItemTypeaccepts less-obvious enum values (note,phoneCall,aiSummary) and rejects invalid ones — regression guard against re-narrowing the enumworkspaceKind: 'template'accepted and forwardedcreatorIds/overviewKindsarrays normalize to "no filter" rather than being sent as[]Not covered by automated tests: no live API call was made against either schema version, so the filters are verified against the schema and mocked client only.
🤖 Generated with Claude Code