feat(codegen): derive idempotentHint + openWorldHint, allow per-action annotation overrides - #69
Merged
Conversation
…n annotation overrides
🦋 Changeset detectedLatest commit: 9652b50 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Member
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
Merged
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.
Completes the MCP tool-annotation set started in #44 (derived
readOnlyHint/destructiveHint, called out there as a hard prerequisite for the Claude Connectors Directory). The codegen now derives all four spec hints per tool and supports explicit per-action overrides.Derivation table (HTTP method → hints)
idempotentHintfollows HTTP semantics (GET/HEAD/PUT/DELETE idempotent, POST not). Per the MCP spec it is only meaningful whenreadOnlyHintis false — it is emitted uniformly, but the values that matter are on the PUT/DELETE/POST tools.openWorldHint: falseeverywhere: this server talks only to the Taskade API — a closed world.Per-action overrides
ActionConfignow accepts explicitreadOnlyHint/destructiveHint/idempotentHint/openWorldHint; an undefined-checked override beats the derived value (so an explicitfalsewins too). This makes future exceptions expressible — e.g. a POST liketaskCompleteis arguably idempotent. No overrides are set in this PR; all generated values are purely derived.Zero-regression proof (A1)
Scripted comparison of per-tool annotation objects between
24f491band the regenerated files:Every pre-existing
readOnlyHint/destructiveHint/titlevalue is byte-identical; the only additions per tool areidempotentHintandopenWorldHint.Changeset
Patch bump for
@taskade/mcp-openapi-codegenand@taskade/mcp-server: "Generated tools now carry the full MCP annotation set: derived idempotentHint and openWorldHint:false alongside readOnly/destructive hints; per-action overrides supported."Test plan
yarn buildregenerates bothtools.generated.ts(57 tools) andtools.v2.generated.ts(5 tools); working tree clean after commit.yarn lintclean.yarn test: 19 tests / 4 files pass, including newcodegen.test.ts(in-memory OpenAPI doc with one GET/POST/PUT/DELETE; asserts all four derived hints per method, plus override cases including an explicit-false override) (A2).