MCPcopy
hub / github.com/simstudioai/sim / serializeCustomTool

Function serializeCustomTool

apps/sim/lib/copilot/vfs/serializers.ts:648–664  ·  view source on GitHub ↗
(tool: {
  id: string
  title: string
  schema: unknown
  code: string
})

Source from the content-addressed store, hash-verified

646 * Serialize a custom tool for VFS custom-tools/{name}.json
647 */
648export function serializeCustomTool(tool: {
649 id: string
650 title: string
651 schema: unknown
652 code: string
653}): string {
654 return JSON.stringify(
655 {
656 id: tool.id,
657 title: tool.title,
658 schema: tool.schema,
659 codePreview: truncate(tool.code, 500),
660 },
661 null,
662 2
663 )
664}
665
666/**
667 * Serialize an MCP server for VFS agent/mcp-servers/{name}.json

Callers 1

Calls 1

truncateFunction · 0.90

Tested by

no test coverage detected