Annotation Interface McpResourceCompletion


@Target(METHOD) @Retention(RUNTIME) public @interface McpResourceCompletion
Annotation for marking methods that provide completion functionality for MCP resources.

This annotation is used to identify methods that can handle completion requests for specific resources in the Model Context Protocol (MCP) server. When applied to a method, it indicates that the method can provide auto-completion suggestions for the specified resource URI.

Methods annotated with @McpResourceCompletion must:

  • Return McpCompleteCompletion
  • Accept exactly one parameter of type McpSchema.CompleteRequest.CompleteArgument
  • Be properly configured with a resource URI

The annotation is retained at runtime and can only be applied to methods. Resource completion is typically used to provide suggestions for resource identifiers, file paths, or other resource-specific parameters.

作者:
codeboyzhou
  • 必需元素概要

    所需元素
    修饰符和类型
    必需的元素
    说明
    Specifies the URI of the resource for which completion is provided.
  • 元素详细资料

    • uri

      String uri
      Specifies the URI of the resource for which completion is provided.

      This value must match the URI of an existing resource that has been registered with the MCP server. The completion method will be invoked when completion requests are made for this specific resource.

      The URI string must be non-null and non-empty. It should uniquely identify the resource within the MCP server context.

      返回:
      the URI of the resource for which completion is provided