Add type hints to MCP function parameters and return types#294
Open
ykd007 wants to merge 1 commit into
Open
Conversation
The mcp/main.py functions had bare dict and list return annotations with no generic parameters. This adds proper typing for IDE support and static analysis tools, and fixes a small typo in the verify_llm docstring (spect -> spec). Closes msoedov#198
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #198
The functions in
agentic_security/mcp/main.pyhad baredictandlistreturn annotations without generic parameters, and one function had a typo in its docstring.Changes:
Anyfromtypingfor use in generic type hintsdict→dict[str, Any]andlist→list[Any]across all MCP tool functionsverify_llmdocstring:spect→specget_data_configdocstring (it referenced stopping the scan instead of describing the data config response)This improves IDE support, makes mypy/pyright output cleaner, and makes the API surface easier to understand at a glance.