Skip to content

feat: implement inflector and naming engine#2

Draft
nallenscott wants to merge 3 commits intomainfrom
feat/inflector-and-naming-engine
Draft

feat: implement inflector and naming engine#2
nallenscott wants to merge 3 commits intomainfrom
feat/inflector-and-naming-engine

Conversation

@nallenscott
Copy link
Copy Markdown
Member

@nallenscott nallenscott commented Mar 7, 2026

Replaces operationId-based tool naming with a deterministic path-based naming engine.

How it works

Each path is parsed into typed components (RESOURCE or PARAM), then processed to produce a camelCase tool name:

/repos/{owner}/{repo}/issues/{id}
   |     |       |      |      |
   |    [params - skipped]     |
   |                           |
container                   resource
(skipped)                 singularized
                        -> "getRepoIssue"

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:

Path Method Tool name
/repos/{owner}/{repo}/issues GET listRepoIssues
/v1/payment_intents POST createPaymentIntent
/2010-04-01/Accounts/{Sid}/Calls.json GET listCalls
/chat.postMessage POST createChatMsg

Changes

  • Adds inflector.ts.. English pluralization/singularization for API resource names
  • Adds tool_naming.ts.. ToolNamingEngine generates consistent camelCase tool names from REST paths
  • Adds dictionaries/abbrs.json (mirrored from ocp-registry).. abbreviation dictionary used by the naming engine
  • Updates openapi_parser.ts to use ToolNamingEngine instead of normalizing operationId

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant