MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / resolve_tools_with_mcp

Function resolve_tools_with_mcp

crates/opencode-session/src/prompt.rs:3103–3119  ·  view source on GitHub ↗
(
    tool_registry: &opencode_tool::ToolRegistry,
    mcp_tools: Vec<ToolDefinition>,
)

Source from the content-addressed store, hash-verified

3101}
3102
3103pub async fn resolve_tools_with_mcp(
3104 tool_registry: &opencode_tool::ToolRegistry,
3105 mcp_tools: Vec<ToolDefinition>,
3106) -> Vec<ToolDefinition> {
3107 let base = tool_registry
3108 .list_schemas()
3109 .await
3110 .into_iter()
3111 .map(|s| ToolDefinition {
3112 name: s.name,
3113 description: Some(s.description),
3114 parameters: s.parameters,
3115 })
3116 .collect();
3117
3118 merge_tool_definitions(base, mcp_tools)
3119}
3120
3121pub async fn resolve_tools_with_mcp_registry(
3122 tool_registry: &opencode_tool::ToolRegistry,

Callers 1

Calls 2

merge_tool_definitionsFunction · 0.85
list_schemasMethod · 0.80

Tested by

no test coverage detected