public static class McpSchema.Resource extends java.lang.Object implements McpSchema.ResourceContent
| 限定符和类型 | 类和说明 |
|---|---|
static class |
McpSchema.Resource.Builder |
| 构造器和说明 |
|---|
Resource(java.lang.String uri,
java.lang.String name,
java.lang.String description,
java.lang.String mimeType,
java.lang.Long size,
McpSchema.Annotations annotations)
已过时。
Only exists for backwards-compatibility purposes. Use
builder() instead. |
Resource(java.lang.String uri,
java.lang.String name,
java.lang.String description,
java.lang.String mimeType,
McpSchema.Annotations annotations)
已过时。
Only exists for backwards-compatibility purposes. Use
builder() instead. |
Resource(java.lang.String uri,
java.lang.String name,
java.lang.String title,
java.lang.String description,
java.lang.String mimeType,
java.lang.Long size,
McpSchema.Annotations annotations)
已过时。
Only exists for backwards-compatibility purposes. Use
builder() instead. |
Resource(java.lang.String uri,
java.lang.String name,
java.lang.String title,
java.lang.String description,
java.lang.String mimeType,
java.lang.Long size,
McpSchema.Annotations annotations,
java.util.Map<java.lang.String,java.lang.Object> meta) |
| 限定符和类型 | 方法和说明 |
|---|---|
McpSchema.Annotations |
annotations() |
static McpSchema.Resource.Builder |
builder() |
java.lang.String |
description() |
java.util.Map<java.lang.String,java.lang.Object> |
meta() |
java.lang.String |
mimeType() |
java.lang.String |
name()
Intended for programmatic or logical use, but used as a display name in past
specs or fallback (if title isn't present).
|
java.lang.Long |
size() |
java.lang.String |
title()
Intended for UI and end-user contexts — optimized to be human-readable and
easily understood, even by those unfamiliar with domain-specific terminology.
|
java.lang.String |
uri() |
public Resource(java.lang.String uri,
java.lang.String name,
java.lang.String title,
java.lang.String description,
java.lang.String mimeType,
java.lang.Long size,
McpSchema.Annotations annotations,
java.util.Map<java.lang.String,java.lang.Object> meta)
uri - the URI of the resource.name - A human-readable name for this resource. This can be used by clients to
populate UI elements.title - An optional title for this resource.description - A description of what this resource represents. This can be used
by clients to improve the LLM's understanding of available resources. It can be
thought of like a "hint" to the model.mimeType - The MIME type of this resource, if known.size - The size of the raw resource content, in bytes (i.e., before base64
encoding or any tokenization), if known. This can be used by Hosts to display file
sizes and estimate context window usage.annotations - Optional annotations for the client. The client can use
annotations to inform how objects are used or displayed.meta - See specification for notes on _meta usage@Deprecated
public Resource(java.lang.String uri,
java.lang.String name,
java.lang.String title,
java.lang.String description,
java.lang.String mimeType,
java.lang.Long size,
McpSchema.Annotations annotations)
builder() instead.@Deprecated
public Resource(java.lang.String uri,
java.lang.String name,
java.lang.String description,
java.lang.String mimeType,
java.lang.Long size,
McpSchema.Annotations annotations)
builder() instead.@Deprecated
public Resource(java.lang.String uri,
java.lang.String name,
java.lang.String description,
java.lang.String mimeType,
McpSchema.Annotations annotations)
builder() instead.public java.lang.String uri()
uri 在接口中 McpSchema.ResourceContentpublic java.lang.String name()
McpSchema.Identifiername 在接口中 McpSchema.Identifierpublic java.lang.String title()
McpSchema.Identifiertitle 在接口中 McpSchema.Identifierpublic java.lang.String description()
description 在接口中 McpSchema.ResourceContentpublic java.lang.String mimeType()
mimeType 在接口中 McpSchema.ResourceContentpublic java.lang.Long size()
size 在接口中 McpSchema.ResourceContentpublic McpSchema.Annotations annotations()
annotations 在接口中 McpSchema.Annotatedpublic java.util.Map<java.lang.String,java.lang.Object> meta()
meta 在接口中 McpSchema.Metapublic static McpSchema.Resource.Builder builder()