expose_callback_docstrings=True exposes docstrings; False hides them.
()
| 179 | |
| 180 | |
| 181 | def test_mcpc006_expose_callback_docstrings(): |
| 182 | """expose_callback_docstrings=True exposes docstrings; False hides them.""" |
| 183 | app = _make_app() |
| 184 | configure_mcp_server(expose_callback_docstrings=True) |
| 185 | app_context.set(app) |
| 186 | app.mcp_callback_map = CallbackAdapterCollection(app) |
| 187 | with app.server.test_request_context(): |
| 188 | tool = app.mcp_callback_map[0].as_mcp_tool |
| 189 | assert "A callback docstring." in tool.description |
| 190 | |
| 191 | app2 = _make_app() |
| 192 | configure_mcp_server(expose_callback_docstrings=False) |
| 193 | app_context.set(app2) |
| 194 | app2.mcp_callback_map = CallbackAdapterCollection(app2) |
| 195 | with app2.server.test_request_context(): |
| 196 | tool2 = app2.mcp_callback_map[0].as_mcp_tool |
| 197 | assert "A callback docstring." not in tool2.description |
| 198 | |
| 199 | |
| 200 | def test_mcpc008_per_callback_false_overrides_server_level_docstrings(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…