Skip to content

docs(mcp): add downloadable MCP tool reference artifact - #1380

Open
FBISiri wants to merge 1 commit into
basicmachines-co:mainfrom
FBISiri:docs/mcp-tool-reference
Open

docs(mcp): add downloadable MCP tool reference artifact#1380
FBISiri wants to merge 1 commit into
basicmachines-co:mainfrom
FBISiri:docs/mcp-tool-reference

Conversation

@FBISiri

@FBISiri FBISiri commented Aug 30, 2026

Copy link
Copy Markdown

Closes #404

What

Adds a generated MCP tool reference document (docs/mcp-tools.md) and
the script that produces it (scripts/generate_tool_docs.py).

Why

Issue #404 requested a downloadable tool usage documentation artifact.
This PR provides a comprehensive reference for all 20+ registered MCP tools,
auto-generated from source to stay current as tools evolve.

How

  • scripts/generate_tool_docs.py uses AST parsing (zero runtime deps) to
    extract tool names, docstrings, parameters, types, and defaults from
    src/basic_memory/mcp/tools/
  • Only documents tools registered in __all__ (no internal helpers)
  • Idempotent: running twice produces identical output
  • To regenerate: uv run scripts/generate_tool_docs.py

Testing

  • Ran the generator; verified all registered tools appear in output
  • Verified idempotency (second run produces zero diff)
  • No existing tests affected (new files only)

Closes basicmachines-co#404

Adds scripts/generate_tool_docs.py — an AST-based generator that
introspects all registered MCP tools and emits docs/mcp-tools.md,
a comprehensive reference covering every tool, its parameters,
types, and usage notes.

The generator has zero runtime dependencies (pure stdlib) and is
idempotent — running it twice produces an identical file.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: FBISiri <masteragentsiri@gmail.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 556dfadbee

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread docs/mcp-tools.md
Comment on lines +358 to +359
- `search_notes("my-project", "keyword")` - Find any content containing "keyword"
- `search_notes("work-docs", "'exact phrase'")` - Search for exact phrase match

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Correct the search_notes argument order in examples

When a reader follows these two-positional-argument examples, the actual search_notes(query, project, ...) signature binds "my-project" to query and "keyword" to project, causing a search for the wrong text in a likely nonexistent project. Rewrite all such examples using explicit query=... and project=... arguments, or reverse their positional order.

AGENTS.md reference: AGENTS.md:L466-L467

Useful? React with 👍 / 👎.

continue
out.append(f"- [{category}](#{_anchor(category)})")
for tool in entries:
out.append(f" - [`{tool.name}`](#{_anchor(tool.name)})")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Disambiguate repeated heading anchors

When a category and tool have the same name, as with the existing Search category and search tool, both TOC entries are emitted as #search. Markdown renderers disambiguate the later heading, so the tool link jumps to the category rather than the tool documentation; track duplicate slugs or emit explicit unique anchors.

Useful? React with 👍 / 👎.

out.append(f"{tool.summary}\n")
detail = tool.description.strip()
if detail:
out.append(f"{detail}\n")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep docstring headings inside each tool section

When a tool description contains Markdown headings, as search_notes already does, appending it verbatim allows ## Search Syntax Examples to close the surrounding ### search_notes section. Its example headings consequently appear as peer tool entries and the parameter table falls under the final example heading in rendered outlines; normalize or demote embedded headings relative to the tool heading before rendering.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOCS] create downloadable tool usage doc artifact

1 participant