get_searchable_property_descriptions
Get searchable property descriptions for a class. Provide the class symbolic name to retrieve only properties marked as searchable.
Instructions
Retrieves only the searchable properties of a class.
:param class_symbolic_name: The symbolic name of the class to retrieve searchable properties for
:returns: A list of CachePropertyDescription objects for properties that are searchable
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| class_symbolic_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- The handler function for the 'get_searchable_property_descriptions' tool. It fetches class metadata via get_class_metadata_tool and filters the property_descriptions to return only those where is_searchable is True.
async def get_searchable_property_descriptions( class_symbolic_name: str, ) -> Union[List[CachePropertyDescription], ToolError]: """ Retrieves only the searchable properties of a class. :param class_symbolic_name: The symbolic name of the class to retrieve searchable properties for :returns: A list of CachePropertyDescription objects for properties that are searchable """ class_metadata = await get_class_metadata_tool( graphql_client=graphql_client, class_symbolic_name=class_symbolic_name, metadata_cache=metadata_cache, ) # If there was an error retrieving the class metadata, return it if isinstance(class_metadata, ToolError): return class_metadata # Filter the properties to include only searchable ones searchable_properties = [ prop for prop in class_metadata.property_descriptions if prop.is_searchable ] # Return only the list of searchable property descriptions return searchable_properties - src/cs_mcp_server/tools/search.py:187-194 (registration)The tool is registered via the @mcp.tool decorator with name='get_searchable_property_descriptions' inside the register_search_tools function, which is called during server setup.
def register_search_tools( mcp: FastMCP, graphql_client: GraphQLClient, metadata_cache: MetadataCache, ) -> None: @mcp.tool( name="get_searchable_property_descriptions", ) - The CachePropertyDescription Pydantic model that defines the schema for the return type. It includes fields like symbolic_name, display_name, descriptive_text, data_type, cardinality, is_searchable, is_system_owned, is_hidden, and valid_search_operators.
class CachePropertyDescription(BaseModel): """Describes detailed attributes or metadata about a property.""" symbolic_name: str = Field( description="Symbolic name that is used to reference this property" ) display_name: str = Field(description="A user displayable name for this property") descriptive_text: str = Field( description="Describes additional details about this property" ) data_type: TypeID = Field(description="The type of data this property can hold") cardinality: Cardinality = Field( description="Whether this property holds a single value or multiple values." ) is_searchable: bool = Field( description="Indicates whether searches can include conditions involving this property" ) is_system_owned: bool = Field( default=False, description="Indicates whether this property is system-owned" ) is_hidden: bool = Field( default=False, description="Indicates whether this property is hidden" ) valid_search_operators: List[SearchOperator] = Field( description="The valid operators that can be used with this property in a search condition" )