Repository navigation
Open
Labels
Description
Summary
lookup_native_tool returns matches in file (alphabetical) order and cuts them at 25 with no offset. Broad queries hide the most relevant natives, deprecated natives do not expose their replacement in a structured way, and the output is prose only.
Where
mcp-server/tools/natives.py:46-62(lookup_native, unranked substring filter)mcp-server/tools/natives.py:104-141(_format_results,show_limit = 25)mcp-server/server.py:51-66(lookup_native_toolsignature).github/scripts/transform_natives.py:197(deprecation detection)
Details
lookup_native("vehicle")returns "Found 1077 native(s)" and shows only the first 25 alphabetical names, followed by "Narrow your search". There is nolimitoroffset.- A name match ranks the same as a description match.
- For deprecated natives the replacement appears only as a markdown link inside the description text (for example
use [HINT_SCRIPT_AUDIO_BANK](#\_0xFB38...)), with noreplaced_byfield.
SCREAMING_SNAKE name matching is tracked in "lookup_native returns nothing for canonical SCREAMING_SNAKE native names".
Impact
For partial or broad queries the native the agent wants is often past the cutoff and unreachable without guessing a narrower string. Agents cannot reliably follow a deprecation to its replacement or parse results.
Suggested fix
- Score matches: exact name, then name prefix, then name substring, then category, then description; sort by score.
- Add
limit(default 25, max 100) andoffsetparameters. - In
transform_natives.py, extract the linked replacement into areplaced_byfield and render it as "Use X instead". - Add an optional
format="json"that returns the raw records.
Acceptance criteria
- An exact-name query lists that native first even when many others match the description.
-
offsetpages through results beyond the first 25. - Deprecated natives with a known replacement show it.
-
format="json"returns parseable records.
Getting started
- Relevant files:
mcp-server/tools/natives.py,mcp-server/server.py,.github/scripts/transform_natives.py - How to run checks: there is no test suite yet; run the MCP server with
cd mcp-server && pip install -r requirements.txt && python server.py, and CI checks live in.github/workflows/validate.yml - Related docs:
skills/native-functions/SKILL.md
Filed by repo-audit/full-audit at 701824d. Severity: medium. Effort: S. audit-key: enhancement|mcp-server/tools/natives.py|ranking
Activity
feat: rank native lookup results and add paging and JSON output (#56)
TMHSDigital commentedon Nov 21, 2026
Partially fixed in f2f5336.
Results are now ranked (exact name, name prefix, name substring, hash, category, description),
limit(1-100) andoffsetpage through them with a next-page hint, andformat="json"returns {total, offset, limit, results}; lookup_native_tool exposes the new parameters.Verified: Tests: an exact name ranks first on real data, offset pages past 25, JSON output parses.
Remaining: the
replaced_byfield ("Use X instead" for deprecated natives) needs a transform_natives.py change and a data refresh, so this issue stays open for that part.