Repository navigation
Search and describe app APIs by method - #297
Merged
tnkuehne merged 3 commits intoNov 22, 2026
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
widefleet-docs | 1701c54 | Nov 22 2026, 03:22 PM |
tnkuehne
force-pushed
the
feat/method-describe
branch
from
November 22, 2026 15:02
818323d to
5b92326
Compare
An agent reading a large API through MCP received one entrypoint's whole documentation and every type at once. Search now returns methods, with their hostname, entrypoint and the first line of their summary, and can list every method of one service. Describe takes the methods to read and returns their signatures, the entrypoint's own documentation and only the types those signatures use, directly or through other types. The service index stores one entry per method and rebuilds indexes of the earlier format. The management API and `widefleet services describe` list an API's methods and describe selected ones with `--entrypoint` and `--method`. The API reference page keeps showing the complete documentation.
The extractor names types as complete type expressions such as `Page<Item>`,
`One.Item` or `import("./model").Item`. Describing a method split these names
into identifiers and missed their definitions. Types are now looked up under
their first identifier and used when a signature contains the whole name.
A type name inside a longer name, such as `One.Item` in `One.ItemDetails` or `Item` in `Two.Item`, no longer counts as a use, and a definition's declaration of its own short name does not pull in an unrelated type of that name.
tnkuehne
force-pushed
the
feat/method-describe
branch
from
November 22, 2026 15:21
245ed2b to
1701c54
Compare
tnkuehne
added a commit
that referenced
this pull request
Nov 22, 2026
## Why #297 finds the types a described method needs by searching its signature texts for documented type names. Generated names take several forms (`Item`, `One.Item`, `Page<Item>`, `import("./model").Item`), and review already found two matching gaps. The extractor resolves every type it documents, so it can state the references exactly instead. ## What changes - **Extractor:** every signature and every type definition gets `uses`, the names of the documented types it uses directly. Undocumented types in between (unions, arrays, library generics such as `Promise` or `Map`) pass their uses through. - **Contract:** documentation format 2 with `uses` (defaults to an empty list). Documentation of format 1 counts as missing in the runtime and the control plane until the app is deployed again. - **Selection:** `selectServiceMethods` follows `uses` from the selected signatures through the type definitions. The text matching is removed. ## Verification - `pnpm check` - `pnpm exec vitest run` (all suites) - `RUN_CLI_TESTS=1` CLI, network CLI, app-services CLI and documentation extraction tests with a freshly built CLI; the extraction tests for generic and namespaced types assert the selected types - `RUN_WASM_TESTS=1 pnpm exec vitest run packages/service-docs` with the rebuilt WebAssembly module - `RUN_SERVICE_TESTS=1` runtime service tests (workerd and celld), `RUN_CLOUDFLARE_TESTS=1` Cloudflare suite, `playwright test tests/e2e/auth.spec.ts` - `bash tools/cargo.sh test` and `clippy --all-targets -D warnings` for `platform-service-docs`, `platform-service-docs-wasm` and `platform-cli`; `fmt --all --check` <!-- greptile_comment --> <!-- greptile_summary --> <h2><a href="https://app.greptile.com/api/retrigger?id=115810480&sig=07cc1fbcf1be1888f1d71a349684cf717c4c1b8a79ff4610861e6d6c0e387fb3"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right"></picture></a><a href="https://app.greptile.com/-/switch-tenant?tenant=mendra&next=%2Fwidefleet%2Fwidefleet%2Fpull%2F303&utm_source=greptile_review&utm_medium=github&utm_campaign=view_in_greptile"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptileDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"><img alt="View in Greptile" src="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2" align="right"></picture></a>Confidence Score: 5/5</h2> <!-- greptile-impact-verdict --> The PR appears safe to merge, with both earlier findings fixed and no new issues found. <details open><summary><h3>Summary</h3></summary> Records exact type references in documentation format 2 and follows those references when selecting methods. - API documentation records the types used by each signature and definition. - Selected API methods include types linked from their signatures. - Older API documentation is treated as missing until the app is redeployed. </details> <!-- greptile_confidence_score:5 --> <sub>Reviews (3) · Last reviewed commit: ["Expect recorded type uses in the app bui..."](e24ceb2) · [Reviewed by Greptile](https://www.greptile.com/?utm_source=greptile_review&utm_medium=github&utm_campaign=review_public&utm_content=widefleet/widefleet)</sub> <!-- /greptile_comment -->
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.
Why
With #290 an app can publish documentation for large APIs (hundreds of methods, thousands of types). MCP
describeandwidefleet services describestill returned an entrypoint's whole document with every type, which floods an agent's context before it calls anything.What changes
MCP
searchreturns methods: hostname, entrypoint, method and the first line of its summary, best matches first.hostnameandentrypointfilters narrow a query or, without words, list every method of a service. They replace the former "exact hostname as query" rule.describetakesmethods(1–20) and returns the entrypoint's documentation with only those methods, plus the types their signatures use, directly or through other types.callonly reaches methods.API and CLI
GET /app-services/{service}returnsdocumented, the list of methods with summaries, anddocumentation: null. Withentrypointandmethods(comma-separated),documentationholds the selected methods and their types.widefleet services describe APP [--entrypoint NAME] [--method NAME]…connections.reference).Selecting methods and their types is shared contract logic (
selectServiceMethods,listServiceMethods), used by the runtime and the control plane.Verification
pnpm checkpnpm exec vitest run(all suites)RUN_SERVICE_TESTS=1 pnpm exec vitest run apps/control-plane/tests/app-services-runtime.test.ts(workerd and celld)RUN_CLOUDFLARE_TESTS=1 pnpm exec vitest run apps/control-plane/tests/cloudflareRUN_CLI_TESTS=1 pnpm exec vitest run apps/control-plane/tests/app-services-cli.test.ts apps/control-plane/tests/service-documentation.test.tswith a freshly built CLIpnpm exec playwright test tests/e2e/auth.spec.tsbash tools/cargo.sh clippy -p platform-cli --all-targets -- -D warnings,fmt --all --checkDocumentation: #298 (draft until a release includes #290 and this PR).


Confidence Score: 5/5
The PR appears safe to merge, with the documentation updates supplied by PR #298.Summary
Changes API discovery from whole services to individual methods.
No new actionable issues were found. Tests were inspected, not run.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Published API documentation] --> B[Method index] B --> C[MCP search] A --> D[selectServiceMethods] D --> E[MCP describe] D --> F[HTTP and CLI selected descriptions] A --> G[Complete reference page]Reviews (4) · Last reviewed commit: "Match type names only as whole names" · Reviewed by Greptile