MCPcopy Index your code
hub / github.com/CopilotKit/CopilotKit / buildFrontendTools

Method buildFrontendTools

packages/core/src/core/run-handler.ts:914–927  ·  view source on GitHub ↗

* Build frontend tools for an agent

(agentId?: string)

Source from the content-addressed store, hash-verified

912 * Build frontend tools for an agent
913 */
914 buildFrontendTools(agentId?: string): Tool[] {
915 return this._tools
916 .filter(
917 (tool) =>
918 tool.available !== false &&
919 (tool.available as boolean | string | undefined) !== "disabled" &&
920 (!tool.agentId || tool.agentId === agentId),
921 )
922 .map((tool) => ({
923 name: tool.name,
924 description: tool.description ?? "",
925 parameters: createToolSchema(tool),
926 }));
927 }
928
929 /**
930 * Create an agent error subscriber

Callers 2

connectAgentMethod · 0.95
runAgentMethod · 0.95

Calls 2

createToolSchemaFunction · 0.85
filterMethod · 0.80

Tested by

no test coverage detected