demo a fix for TargetEntity #152
Open
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.
This fixes some of the issues reported in #148
The
List[Any]type hints are still a problem so the functions in this module that also have that issue remain broken.The
TargetEntitychange does fixgoogle_chronicle_get_rule_detailsfor example (b/c it does not useList[Any])Here is gemini's explanation of the issue:
Fix FastMCP tool registration issues with TargetEntity type
Changed
target_entitiesparameter type fromList[TargetEntity]toList[Dict[str, str]]across all tool definitions. FastMCP's schema generator cannot properly resolve Pydantic model types in tool parameters, causing tools to be skipped during registration with "missing types in parameter schema" errors. This issue persists even when defining the model locally within the same module.The simpler
Dict[str, str]type uses only built-in Python types that FastMCP can reliably serialize into its parameter schema. Inside each tool function, we now convert the dictionaries back toTargetEntityobjects usingtarget_entities = [TargetEntity(**entity) for entity in target_entities]to maintain type safety and compatibility with the rest of the codebase.This change ensures all tools are properly registered while preserving the existing business logic and type validation.