import type { Tool } from "jsonv-ts/mcp"; import components from "fumadocs-ui/mdx"; import { TypeTable } from "fumadocs-ui/components/type-table"; import { DynamicCodeBlock } from "fumadocs-ui/components/dynamic-codeblock"; import type { JSONSchemaDefinition } from "jsonv-ts"; export const slugify = (s: string) => s.toLowerCase().replace(/ /g, "-"); export const indent = (s: string, indent = 2) => s.replace(/^/gm, " ".repeat(indent)); export function McpTool({ tool }: { tool: ReturnType }) { return (
{tool.name}

{tool.description}

); } export function JsonSchemaTypeTable({ schema }: { schema: JSONSchemaDefinition }) { const properties = schema.properties ?? {}; const required = schema.required ?? []; const getTypeDescription = (value: any) => JSON.stringify( { ...value, $target: undefined, }, null, 2, ); return Object.keys(properties).length > 0 ? ( [ key, { description: value.description, typeDescription: ( ), type: value.type, default: value.default ? JSON.stringify(value.default) : undefined, required: required.includes(key), }, ]), )} /> ) : null; }