Skip to content

fix: hide MCP tools without explicit read-only hint - #31

Merged
VikramLex merged 1 commit into
Graphicle-AI:mainfrom
dajiaohuang:w5/python-sdk-readonly-hint-20261112
Nov 13, 2026
Merged

VikramLex merged 1 commit into
Graphicle-AI:mainfrom
dajiaohuang:w5/python-sdk-readonly-hint-20261112

Conversation

@dajiaohuang

Copy link
Copy Markdown
Contributor

Problem

The Python SDK treated a missing MCP readOnlyHint as read-only. The service treats a tool as a write unless it explicitly declares readOnlyHint: true, and extension tool specs can be published without that annotation. As a result, Tools(project) could publish an unmarked write tool to a model despite include_write=False.

Change

Only tools with an explicit readOnlyHint: true are exposed by default. include_write=True continues to opt into all published tools. The regression test covers explicit read, explicit write, empty annotations, and missing annotations.

Validation

  • py -3 -m pytest -q tests/test_tools.py: 1 passed (pytest plugin auto-loading disabled for this process because a machine-level Home Assistant plugin imports POSIX-only fcntl on Windows).
  • git diff --check: passed.
  • No CI queried.

Signed-off-by: dajiaohuang <mikewushuwen@outlook.com>
@dajiaohuang
dajiaohuang marked this pull request as ready for review November 12, 2026 16:56
@VikramLex
VikramLex merged commit 013d09d into Graphicle-AI:main Nov 13, 2026
11 checks passed
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.

2 participants