NumPy allowed · plain Python earns 10 bonus points
Implement tool-description context-budget fitting, deciding how many of an agent's available tool descriptions actually fit in its system prompt.
Implement fit_tool_budget(tools, token_budget). tools is a list of {"name": str, "priority": float, "tokens": int}, sorted here by you in DESCENDING priority. Greedily include tools in that order while the running token total stays <= token_budget. Return the included tool names in the order they were included.
fit_tool_budget(tools: list[dict], token_budget: int) -> list[str]