Annotation Type McpToolProperty


  • @Target(PARAMETER)
    @Retention(RUNTIME)
    public @interface McpToolProperty
    Defines a strongly-typed input property for an MCP tool function parameter.

    Alternative to using JSON format in McpToolTrigger.toolProperties(). Each annotated parameter receives a specific value from the tool invocation arguments.

    Example:

     @FunctionName("searchFiles")
     public HttpResponseMessage search(
         @McpToolTrigger(name = "context", description = "Search files") String context,
         @McpToolProperty(
             name = "query",
             propertyName = "searchTerm",
             propertyType = "string",
             description = "Search term",
             required = true
         ) String searchTerm
     ) {
         // Use searchTerm directly
     }
     
    Since:
    3.2.0
    See Also:
    McpToolTrigger
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String name
      The parameter binding name for the Azure Functions runtime.
      java.lang.String propertyType
      The expected data type (e.g., "string", "number", "boolean", "array", "object").
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String description
      Description of the property's purpose and usage.
      boolean isArray
      Whether this property is an array.
      boolean isRequired
      Whether this property is required for tool execution.
    • Element Detail

      • name

        java.lang.String name
        The parameter binding name for the Azure Functions runtime.
        Returns:
        The parameter binding name
      • propertyType

        java.lang.String propertyType
        The expected data type (e.g., "string", "number", "boolean", "array", "object").
        Returns:
        The property type identifier
      • description

        java.lang.String description
        Description of the property's purpose and usage.
        Returns:
        Description of the property
        Default:
        ""
      • isRequired

        boolean isRequired
        Whether this property is required for tool execution.
        Returns:
        true if required, false if optional
        Default:
        false
      • isArray

        boolean isArray
        Whether this property is an array.
        Returns:
        true if this property is an array, false otherwise
        Default:
        false