flutter_mentions
Parse @flutter_mcp mentions in text and resolve each to Flutter, Dart SDK, or pub.dev docs, returning one result per mention with version and content.
Instructions
Parse every @flutter_mcp mention in a text and resolve each one to its docs.
Mention grammar (identifier forms are the same flutter_docs accepts):
"@flutter_mcp provider" pub.dev package, latest release
"@flutter_mcp provider:^6.0.0" caret constraint
"@flutter_mcp provider:6.1.5" exact published release
"@flutter_mcp dio:>=5.0.0 <6.0.0" range, space separated
"@flutter_mcp provider:latest" explicit latest
"@flutter_mcp pub:dio" / "pub:dio:5.4.0"
"@flutter_mcp material.AppBar" Flutter class, library given
"@flutter_mcp dart:async.Future" Dart SDK class
"@flutter_mcp Container" plain name
A version constraint is answered from pub.dev's own list of published releases: an exact pin is returned when published, a range resolves to the newest release that satisfies it (pre-releases are excluded unless the constraint asks for one), and the constraint that was requested is always reported next to the version that was resolved. A version that does not exist is reported as missing with the nearest published releases — never replaced by a different version.
Args: text: any text containing zero or more @flutter_mcp mentions. max_tokens: rough token budget for each mention's documentation payload (1 token ≈ 4 chars). Non-positive disables truncation.
Returns {"mentions": n, "max_tokens": ..., "results": [...]} with exactly one entry per mention, in document order. Each entry carries "mention" (as written), "type" (flutter_class | dart_class | pub_package | not_found | error), the resolved "identifier" and "version", and the docs payload ("content", "truncated", "tokens", "source_tokens", "max_tokens", plus "truncation" when something was cut). Failures are per-mention {"type": "not_found" | "error", "error", "suggestion"} — one bad mention never removes or duplicates another mention's entry.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| max_tokens | No |