nlweb-tools-framework
Installation
SKILL.md
NLWeb Tools Framework
Before writing code
Fetch live docs:
- Fetch https://github.com/nlweb-ai/NLWeb/blob/main/docs/tools.md for the canonical tools framework reference.
- Fetch https://github.com/nlweb-ai/NLWeb/blob/main/config/site_types.xml for the per-type tool inheritance tree.
- Read
AskAgent/python/core/router.py::ToolSelectorfor how routing actually picks a tool. - Read existing handlers in
AskAgent/python/methods/:generate_answer.py,item_details.py,compare_items.py,ensemble_tool.py,recipe_substitution.py,accompaniment.py. - Fetch https://github.com/nlweb-ai/NLWeb/blob/main/docs/nlweb-prompts.md for the
<returnStruc>JSON contract that handlers must satisfy.
Conceptual Architecture
What a "Tool" Is in NLWeb
Confusingly, "tool" means two different things in NLWeb depending on context:
- Internal tool / handler — a Python module in
methods/that theToolSelectorroutes a query to (e.g.,compare_items.py). This is the meaning used in this skill. - MCP tool — the JSON-RPC tool exposed at
/mcp(ask,list_sites,who). See thenlweb-mcp-serverskill for that meaning.