MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / parseToolAddress

Function parseToolAddress

packages/core/sdk/src/executor.ts:313–338  ·  view source on GitHub ↗
(address: string)

Source from the content-addressed store, hash-verified

311 * `tools.<integration>.<owner>.<connection>.aliases.deleteAlias` — the same
312 * dotted nesting the sandbox `tools` proxy produces from property access. */
313export const parseToolAddress = (address: string): ParsedToolAddress | null => {
314 // Walk to the 4th dot; everything past it is the tool (dots and all).
315 let cut = -1;
316 for (let i = 0; i < 4; i++) {
317 cut = address.indexOf(".", cut + 1);
318 if (cut === -1) return null;
319 }
320 const [prefix, integration, owner, connection] = address.slice(0, cut).split(".") as [
321 string,
322 string,
323 string,
324 string,
325 ];
326 const tool = address.slice(cut + 1);
327 if (prefix !== ADDRESS_PREFIX) return null;
328 if (!isOwner(owner)) return null;
329 if (integration.length === 0 || connection.length === 0 || tool.length === 0) {
330 return null;
331 }
332 return {
333 integration: IntegrationSlug.make(integration),
334 owner,
335 connection: ConnectionName.make(connection),
336 tool: ToolName.make(tool),
337 };
338};
339
340export const connectionAddress = (
341 owner: Owner,

Callers 7

pathToAddressFunction · 0.90
makeExecutorToolInvokerFunction · 0.90
registerPassthroughToolsFunction · 0.90
executePassthroughCallFunction · 0.90
toolSchemaFunction · 0.85
policiesResolveFunction · 0.85
executeFunction · 0.85

Calls 1

isOwnerFunction · 0.85

Tested by

no test coverage detected