Repository navigation
Description
Summary
transform_natives.py labels some client-only GTA5 game natives as shared or server, because it applies name patterns meant for CFX server natives to game natives with the same PascalCase name. It also sets the deprecated flag from the raw description including code samples, marking natives such as SetPedCombatAttributes deprecated.
Where
.github/scripts/transform_natives.py:53-77(SERVER_SIDE_PATTERNS,SHARED_PATTERNS).github/scripts/transform_natives.py:84-104(classify_side).github/scripts/transform_natives.py:173-174,.github/scripts/transform_natives.py:197(deprecated = bool(DEPRECATED_RE.search(raw_desc)))mcp-server/data/natives_gta5.jsonmcp-server/tools/natives.py:50(side filter)
Details
Side. classify_side uses apiset only when present (CFX natives). For game natives it matches the name against SERVER_SIDE_PATTERNS and SHARED_PATTERNS, which list CFX server-native names (GetPlayerMaxArmour, GetPlayerPed, GetPlayerName, DeleteEntity, GetEntityHealth, ...). Game natives that share those names inherit the labels. Current data: GetPlayerMaxArmour (PLAYER) is server; GetPlayerPed, GetPlayerName, IsPlayerPlaying (PLAYER) and DeleteEntity, GetEntityHealth (ENTITY) are shared. These are client-only RAGE natives taking a client Player index; the CFX server versions are separate entries. In total, 12 non-CFX entries in natives_gta5.json are not labelled client.
Deprecated. The regex runs on raw_desc (including fenced code blocks) instead of the cleaned description. 2 of the 19 flagged GTA5 natives (SetPedCombatAttributes, TaskPlaneMission) have no "deprecated" wording in their cleaned description. Any text like "replaces the deprecated X" would also flag a native.
Open question (unverified). Lines 142-146 merge all CFX natives into both the GTA5 and RDR3 databases, so GTA-only CFX natives such as SetVehicleHandlingFloat appear in natives_rdr3.json. It is not confirmed whether upstream natives_cfx.json carries a per-game marker that should be used to filter them.
Impact
lookup_native_tool(query='GetPlayerPed', side='server') returns the client signature GetPlayerPed(Player) labelled shared next to the real server one, and GetPlayerMaxArmour with side='client' drops the client native entirely. [DEPRECATED] on a widely used native pushes agents away from correct code.
Steps to reproduce
cd mcp-serverpython -c "from tools.natives import lookup_native as l; print(l('GetPlayerMaxArmour','gta5','client','./data'))"omits the PLAYER native.python -c "from tools.natives import lookup_native as l; print(l('SetPedCombatAttributes','gta5',None,'./data')[:120])"shows[DEPRECATED].
Suggested fix
- Apply the name heuristics only to
category == 'CFX'entries withoutapiset; default every non-CFX game native toclient. - Run the deprecation regex on the cleaned
description, and prefer phrases such as "is deprecated" or "marked as deprecated". - Investigate the per-game filtering question for CFX natives.
- Rerun the transform (or the
update-natives.ymlworkflow) and commit the regenerated data.
Acceptance criteria
- Every non-CFX entry in
natives_gta5.jsonandnatives_rdr3.jsonhasside: "client". -
SetPedCombatAttributesandTaskPlaneMissionare no longer flagged deprecated; natives whose description says they are deprecated still are. - The CFX-native per-game question is answered (filtered, or documented as intentional).
Getting started
- Relevant files:
.github/scripts/transform_natives.py,.github/workflows/update-natives.yml,mcp-server/data/natives_gta5.json,mcp-server/data/natives_rdr3.json - 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,CLAUDE.md(Running validation)
Filed by repo-audit/full-audit at 701824d. Severity: medium. Effort: S. audit-key: bug|.github/scripts/transform_natives.py|classify_side
Activity
TMHSDigital commentedon Nov 21, 2026
Fixed in fdacbd7.
Game natives are classified client (name heuristics now apply to CFX natives only), deprecation is matched in the cleaned description and only when the native itself is said to be deprecated, and CFX natives are merged per game using upstream's "game" field (which answers the open question: upstream does mark 445 as gta5, 29 as rdr3, 2 as ny). The committed DBs were re-processed with the fixed functions (no upstream refresh).
Verified: Every non-CFX entry is client in both DBs; GetPlayerMaxArmour is returned for side=client; SetPedCombatAttributes and TaskPlaneMission are no longer deprecated; 31 non-GTA5 CFX natives left the GTA5 DB and 447 non-RDR3 ones left the RDR3 DB (including SetVehicleHandlingFloat).