ChainGraph API Documentation / @badaitech/chaingraph-trpc / server / MCPNodeBuilderService
Class: MCPNodeBuilderService
Defined in: packages/chaingraph-trpc/server/mcp/services/mcp-node-builder.service.ts:24
Constructors
Constructor
new MCPNodeBuilderService(
nodeRegistry):MCPNodeBuilderService
Defined in: packages/chaingraph-trpc/server/mcp/services/mcp-node-builder.service.ts:25
Parameters
nodeRegistry
Returns
MCPNodeBuilderService
Methods
buildPromptNode()
buildPromptNode(
server,prompt):INode
Defined in: packages/chaingraph-trpc/server/mcp/services/mcp-node-builder.service.ts:289
Parameters
server
prompt
_meta?
{[key: string]: unknown; }
See MCP specification for notes on _meta usage.
arguments?
object[]
A list of arguments to use for templating the prompt.
description?
string
An optional description of what this prompt provides
icons?
object[]
An optional list of icons for this prompt.
name
string
Intended for programmatic or logical use, but used as a display name in past specs or fallback
title?
string
Intended for UI and end-user contexts — optimized to be human-readable and easily understood, even by those unfamiliar with domain-specific terminology.
If not provided, the name should be used for display (except for Tool, where annotations.title should be given precedence over using name, if present).
Returns
buildResourceNode()
buildResourceNode(
server,resource):INode
Defined in: packages/chaingraph-trpc/server/mcp/services/mcp-node-builder.service.ts:190
Parameters
server
resource
{[key: string]: unknown; _meta?: {[key: string]: unknown; }; description?: string; icons?: object[]; mimeType?: string; name: string; title?: string; uri: string; }
_meta?
{[key: string]: unknown; }
See MCP specification for notes on _meta usage.
description?
string
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.
icons?
object[]
An optional list of icons for this resource.
mimeType?
string
The MIME type of this resource, if known.
name
string
Intended for programmatic or logical use, but used as a display name in past specs or fallback
title?
string
Intended for UI and end-user contexts — optimized to be human-readable and easily understood, even by those unfamiliar with domain-specific terminology.
If not provided, the name should be used for display (except for Tool, where annotations.title should be given precedence over using name, if present).
uri
string
The URI of this resource.
|
{[key: string]: unknown; _meta?: {[key: string]: unknown; }; description?: string; mimeType?: string; name: string; title?: string; uriTemplate: string; }
_meta?
{[key: string]: unknown; }
See MCP specification for notes on _meta usage.
description?
string
A description of what this template is for.
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?
string
The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
name
string
Intended for programmatic or logical use, but used as a display name in past specs or fallback
title?
string
Intended for UI and end-user contexts — optimized to be human-readable and easily understood, even by those unfamiliar with domain-specific terminology.
If not provided, the name should be used for display (except for Tool, where annotations.title should be given precedence over using name, if present).
uriTemplate
string
A URI template (according to RFC 6570) that can be used to construct resource URIs.
Returns
buildToolNode()
buildToolNode(
server,tool):Promise<INode>
Defined in: packages/chaingraph-trpc/server/mcp/services/mcp-node-builder.service.ts:27
Parameters
server
tool
_meta?
{[key: string]: unknown; }
See MCP specification for notes on _meta usage.
annotations?
{[key: string]: unknown; destructiveHint?: boolean; idempotentHint?: boolean; openWorldHint?: boolean; readOnlyHint?: boolean; title?: string; }
Optional additional tool information.
annotations.destructiveHint?
boolean
If true, the tool may perform destructive updates to its environment. If false, the tool performs only additive updates.
(This property is meaningful only when readOnlyHint == false)
Default: true
annotations.idempotentHint?
boolean
If true, calling the tool repeatedly with the same arguments will have no additional effect on the its environment.
(This property is meaningful only when readOnlyHint == false)
Default: false
annotations.openWorldHint?
boolean
If true, this tool may interact with an "open world" of external entities. If false, the tool's domain of interaction is closed. For example, the world of a web search tool is open, whereas that of a memory tool is not.
Default: true
annotations.readOnlyHint?
boolean
If true, the tool does not modify its environment.
Default: false
annotations.title?
string
A human-readable title for the tool.
description?
string
A human-readable description of the tool.
icons?
object[]
An optional list of icons for this tool.
inputSchema
{[key: string]: unknown; properties?: {[key: string]: unknown; }; required?: string[]; type: "object"; }
A JSON Schema object defining the expected parameters for the tool.
inputSchema.properties?
{[key: string]: unknown; }
inputSchema.required?
string[]
inputSchema.type
"object"
name
string
Intended for programmatic or logical use, but used as a display name in past specs or fallback
outputSchema?
{[key: string]: unknown; properties?: {[key: string]: unknown; }; required?: string[]; type: "object"; }
An optional JSON Schema object defining the structure of the tool's output returned in the structuredContent field of a CallToolResult.
outputSchema.properties?
{[key: string]: unknown; }
outputSchema.required?
string[]
outputSchema.type
"object"
title?
string
Intended for UI and end-user contexts — optimized to be human-readable and easily understood, even by those unfamiliar with domain-specific terminology.
If not provided, the name should be used for display (except for Tool, where annotations.title should be given precedence over using name, if present).
Returns
Promise<INode>