Draft
Conversation
- Add splitHeadWord() to extract first word of a compound resource segment (handles snake_case, kebab-case, camelCase) - Add deduplicateAdjacentPrefix() to collapse stutter from source API paths where resources[i+1] starts with the tail word of resources[i] (e.g. workflow + workflowSchemes -> workflow + Schemes) - Insert as step 7b in generateToolName() pipeline, after singularization and before abbreviation expansion - Add unit tests for splitHeadWord, deduplicateAdjacentPrefix, and integration tests for end-to-end name generation (362 tests total) - Fix irregular inflections in inflector.ts
- Remove 5 extra irregulars not present in Python (human, sex, move, zombie, yes) — boilerplate remnants not relevant to API paths - Change datum → data to datum → datums, matching Python's explicit override of the Latin -um→-a rule (datum is a geodetic term)
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.
Replaces operationId-based tool naming with a deterministic path-based naming engine.
How it works
Each path is parsed into typed components (
RESOURCEorPARAM), then processed to produce a camelCase tool name:A container is a resource that scopes other resources through path parameters — it's dropped since it does not describe the operation. The remaining resource chain is singularized or pluralized based on position and HTTP method, then abbreviated where applicable.
This generalizes across API conventions:
/repos/{owner}/{repo}/issueslistRepoIssues/v1/payment_intentscreatePaymentIntent/2010-04-01/Accounts/{Sid}/Calls.jsonlistCalls/chat.postMessagecreateChatMsgChanges
inflector.ts.. English pluralization/singularization for API resource namestool_naming.ts..ToolNamingEnginegenerates consistent camelCase tool names from REST pathsdictionaries/abbrs.json(mirrored from ocp-registry).. abbreviation dictionary used by the naming engineopenapi_parser.tsto useToolNamingEngineinstead of normalizing operationId