import { FastifyInstance, FastifyRequest } from "fastify"

export type McpContext = {
    server: FastifyInstance
    request: FastifyRequest
    tenantId: number
    userId: string
    isAdmin: boolean
    permissions: string[]
}

export type McpToolResult = {
    content: Array<{
        type: "text"
        text: string
    }>
    structuredContent?: Record<string, unknown>
    isError?: boolean
}

export type McpTool = {
    name: string
    title: string
    description: string
    requiredPermissions: string[]
    inputSchema: Record<string, unknown>
    handler: (context: McpContext, args: Record<string, unknown>) => Promise<unknown>
}

export type JsonRpcRequest = {
    jsonrpc?: string
    id?: string | number | null
    method?: string
    params?: any
}

