propose: list_clients MCP tool — outbound counterpart to list_routes#37
Merged
Conversation
…utes Companion propose to the v2 brownfield annotations PR (#36). After v2 lands, Feign declarations leave the Route table — they're correctly modeled as outbound @CodebaseClient annotations rather than inbound routes. This leaves a real workflow without an entry point: "show me every outbound HTTP call this service makes". Pre-v2, agents reach for list_routes(framework=feign), which is wrong on three counts (only Feign, conflates direction, returns nothing post-v2). The propose adds: 1. A new Client graph node table storing outbound-client declarations (one row per @CodebaseClient annotation; Feign methods synthesised from source). 2. A new DECLARES_CLIENT(Symbol → Client) rel table mirroring the existing EXPOSES(Symbol → Route) edge. 3. A list_clients MCP tool with filters symmetric to list_routes (microservice, client_kind, target_service, path_prefix, method). The HTTP_CALLS(Symbol → Route) edge stays unchanged — Client is additional caller-side metadata, not a replacement. Pass6's hint recovery walk retargets from the caller's http_consumer route to the caller's DECLARES_CLIENT → Client path. Same data, new home. Three follow-up tools sketched but punted: - get_client_by_path (symmetric with get_route_by_path) - find_client_callers - find_client_target_route A parallel Producer node + list_async_producers tool is also flagged as future work for the async outbound side. ONTOLOGY_VERSION bump: 9 → 10. No code change in this propose; doc-only.
3 tasks
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
Companion propose to PR #36 (brownfield annotations v2). After v2 lands, Feign declarations leave the
Routetable because they're correctly modeled as outbound@CodebaseClientannotations rather than inbound routes. This leaves a real workflow without an entry point:Pre-v2, agents reach for
list_routes(framework=feign)— which is wrong on three counts:RestTemplate/WebClientcall sites with@CodebaseClientoverrides are invisible.Routetable).This propose closes the gap with a first-class outbound-client query path.
What lands
Clientgraph node table — one row per@CodebaseClientannotation (Feign methods synthesised from source; imperative call sites only when explicitly annotated).DECLARES_CLIENT(Symbol → Client)rel table — mirrors the existingEXPOSES(Symbol → Route)edge.list_clientsMCP tool — filters symmetric tolist_routes:microservice,client_kind,target_service,path_prefix,method.HTTP_CALLS(Symbol → Route)stays unchanged —Clientis additional caller-side metadata, not a replacement. Pass6's hint-recovery walk retargets from the caller'shttp_consumerroute to the caller'sDECLARES_CLIENT → Clientpath. Same data, new home.Surface
ClientRowDtomirrorsRouteRowDtofield-for-field where applicable (id,path,path_template,path_regex,method,microservice,module,filename,start_line,end_line,resolved) plusclient_kind,target_service,member_fqn,member_id.Out of scope (sketched, separate proposals)
get_client_by_path(microservice, path_template, method)— symmetric withget_route_by_pathfind_client_callers(client_id)find_client_target_route(client_id)Producernode +list_async_producers(the async outbound parallel)Open questions inside
target_serviceforeign-key vs string — recommend string for v1Clientcarry call-edge resolution outcome — recommend keep onHTTP_CALLSonlylist_clientsvslist_http_clientsnaming — recommend the shorter formClientrows for un-annotated RestTemplate/WebClient call sites — recommend opt-in via@CodebaseClientfor v1Schema impact
ONTOLOGY_VERSIONbump: 9 → 10. Additive (new node + rel tables only); no destructive schema changes.Tests
This is a doc-only propose; no code changes. Test baseline unchanged.
Sequencing
This PR depends on PR #36 (v2 annotations) landing first. The data the tool reads from doesn't exist until v2 reshapes how Feign declarations are stored. Implementation PRs for
list_clientsfollow after v2 implementation.