11import { PromptMessage } from "@modelcontextprotocol/sdk/types.js" ;
2- import { z , ZodTypeAny } from "zod" ;
3- import { zodToJsonSchema } from "zod-to-json-schema" ;
42import type { FirebaseMcpServer } from "./index" ;
53import type { Config } from "../config" ;
64import { RC } from "../rc" ;
7- import { cleanSchema } from "./util" ;
85
96export interface ServerPromptContext {
107 projectId : string ;
@@ -14,11 +11,11 @@ export interface ServerPromptContext {
1411 rc : RC ;
1512}
1613
17- export interface ServerPrompt < InputSchema extends ZodTypeAny = ZodTypeAny > {
14+ export interface ServerPrompt {
1815 mcp : {
1916 name : string ;
2017 description ?: string ;
21- inputSchema : any ;
18+ arguments ?: { name : string ; description ?: string ; required ?: boolean } [ ] ;
2219 omitPrefix ?: boolean ;
2320 annotations ?: {
2421 title ?: string ;
@@ -28,19 +25,12 @@ export interface ServerPrompt<InputSchema extends ZodTypeAny = ZodTypeAny> {
2825 feature ?: string ;
2926 } ;
3027 } ;
31- fn : ( input : z . infer < InputSchema > , ctx : ServerPromptContext ) => Promise < PromptMessage [ ] > ;
28+ fn : ( args : Record < string , string > , ctx : ServerPromptContext ) => Promise < PromptMessage [ ] > ;
3229}
3330
34- export function prompt < InputSchema extends ZodTypeAny > (
35- options : Omit < ServerPrompt < InputSchema > [ "mcp" ] , "inputSchema" | "name" > & {
36- name : string ;
37- inputSchema : InputSchema ;
38- omitPrefix ?: boolean ;
39- } ,
40- fn : ServerPrompt < InputSchema > [ "fn" ] ,
41- ) : ServerPrompt {
31+ export function prompt ( options : ServerPrompt [ "mcp" ] , fn : ServerPrompt [ "fn" ] ) : ServerPrompt {
4232 return {
43- mcp : { ... options , inputSchema : cleanSchema ( zodToJsonSchema ( options . inputSchema ) ) } ,
33+ mcp : options ,
4434 fn,
4535 } ;
4636}
0 commit comments