
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@utcp/direct-call
Advanced tools
Direct callable functions plugin for UTCP (Universal Tool Calling Protocol).
This plugin allows you to register and call JavaScript/TypeScript functions directly as UTCP tools, without the need for external APIs or file-based configurations.
addFunctionToUtcpDirectCall() to register functions at the global levelnpm install @utcp/direct-call
Important: When UTCP calls your registered functions, it spreads the toolArgs object properties as separate parameters. For example, if toolArgs is { name: 'Alice', age: 30 }, your function will be called as yourFunction('Alice', 30), not yourFunction({ name: 'Alice', age: 30 }).
addFunctionToUtcpDirectCallimport { addFunctionToUtcpDirectCall } from '@utcp/direct-call';
import { UtcpManual } from '@utcp/sdk';
// Register a function that returns a UTCP manual
const getMyManual = addFunctionToUtcpDirectCall('myManual', async (): Promise<UtcpManual> => {
return {
utcp_version: '1.0.0',
manual_version: '1.0.0',
tools: [
{
name: 'exampleTool',
description: 'An example tool',
inputs: { type: 'object', properties: {} },
outputs: { type: 'object', properties: {} },
tags: [],
tool_call_template: {
call_template_type: 'direct-call',
callable_name: 'exampleTool'
}
}
]
};
});
// Register a tool function
const myTool = addFunctionToUtcpDirectCall('exampleTool', async (...args: any[]): Promise<any> => {
return { result: 'Hello from direct call!' };
});
// You can also use named functions
// Note: Parameters are spread from the toolArgs object
async function greet(name: string) {
return `Hello, ${name}!`;
}
addFunctionToUtcpDirectCall('greet', greet);
import { DirectCommunicationProtocol } from '@utcp/direct-call';
import { UtcpManual } from '@utcp/sdk';
const protocol = new DirectCommunicationProtocol();
// Register a callable for returning manuals
protocol.registerCallable('myManual', async () => {
return {
utcp_version: '1.0.0',
manual_version: '1.0.0',
tools: []
} as UtcpManual;
});
// Register a callable for tool execution
protocol.registerCallable('myTool', async (...args: any[]) => {
return { result: 'Success!' };
});
MPL-2.0
FAQs
Direct callable functions plugin for UTCP
We found that @utcp/direct-call demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.