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”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: | MCPToolFilterCallable | MCPToolFilterStatic;Inherited from
Section titled “Inherited from”toolMetaResolver?
Section titled “toolMetaResolver?”optional toolMetaResolver: MCPToolMetaResolver;Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”callTool()
Section titled “callTool()”callTool( toolName, args,meta?): Promise<object[]>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<object[]>
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>