MCPServerWithResources
이 콘텐츠는 아직 번역되지 않았습니다.
Extended MCP server surface for servers that expose resources.
Extends
Section titled “Extends”Properties
Section titled “Properties”cacheToolsList
Section titled “cacheToolsList”cacheToolsList: boolean;Inherited from
Section titled “Inherited from”customDataExtractor?
Section titled “customDataExtractor?”optional customDataExtractor?: MCPToolCustomDataExtractor;Inherited from
Section titled “Inherited from”errorFunction?
Section titled “errorFunction?”optional errorFunction?: | MCPToolErrorFunction | null;Optional function to convert MCP tool failures into model-visible messages. Set to null to rethrow errors instead of converting them.
Inherited from
Section titled “Inherited from”readonly name: string;Inherited from
Section titled “Inherited from”toolFilter?
Section titled “toolFilter?”optional toolFilter?: | MCPToolFilterStatic | MCPToolFilterCallable;Inherited from
Section titled “Inherited from”toolMetaResolver?
Section titled “toolMetaResolver?”optional toolMetaResolver?: MCPToolMetaResolver;Inherited from
Section titled “Inherited from”useStructuredContent?
Section titled “useStructuredContent?”optional useStructuredContent?: boolean;Whether to use MCP structuredContent as the model-visible tool output when available.
Defaults to false to preserve the existing content-based output behavior.
Inherited from
Section titled “Inherited from”MCPServer.useStructuredContent
Methods
Section titled “Methods”callTool()
Section titled “callTool()”callTool( toolName, args,meta?): Promise<CallToolResultContent>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<CallToolResultContent>
Inherited from
Section titled “Inherited from”callToolResult()?
Section titled “callToolResult()?”optional callToolResult( toolName, args, meta?): Promise<{ _meta?: Record<string, unknown>; content: object[]; isError?: boolean; structuredContent?: Record<string, unknown>;}>;Invoke a tool and return the full serializable MCP result.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<{
_meta?: Record<string, unknown>;
content: object[];
isError?: boolean;
structuredContent?: Record<string, unknown>;
}>
Inherited from
Section titled “Inherited from”close()
Section titled “close()”close(): Promise<void>;Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”connect()
Section titled “connect()”connect(): Promise<void>;Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”invalidateToolsCache()
Section titled “invalidateToolsCache()”invalidateToolsCache(): Promise<void>;Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”MCPServer.invalidateToolsCache
listResources()
Section titled “listResources()”listResources(params?): Promise<MCPListResourcesResult>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
Returns
Section titled “Returns”Promise<MCPListResourcesResult>
listResourceTemplates()
Section titled “listResourceTemplates()”listResourceTemplates(params?): Promise<MCPListResourceTemplatesResult>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
Returns
Section titled “Returns”Promise<MCPListResourceTemplatesResult>
listTools()
Section titled “listTools()”listTools(): Promise<object[]>;Returns
Section titled “Returns”Promise<object[]>
Inherited from
Section titled “Inherited from”readResource()
Section titled “readResource()”readResource(uri): Promise<MCPReadResourceResult>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”Promise<MCPReadResourceResult>