1
1
import { PromptMessage } from "@modelcontextprotocol/sdk/types.js" ;
2
- import { z , ZodTypeAny } from "zod" ;
3
- import { zodToJsonSchema } from "zod-to-json-schema" ;
4
2
import type { FirebaseMcpServer } from "./index" ;
5
3
import type { Config } from "../config" ;
6
4
import { RC } from "../rc" ;
7
- import { cleanSchema } from "./util" ;
8
5
9
6
export interface ServerPromptContext {
10
7
projectId : string ;
@@ -14,11 +11,11 @@ export interface ServerPromptContext {
14
11
rc : RC ;
15
12
}
16
13
17
- export interface ServerPrompt < InputSchema extends ZodTypeAny = ZodTypeAny > {
14
+ export interface ServerPrompt {
18
15
mcp : {
19
16
name : string ;
20
17
description ?: string ;
21
- inputSchema : any ;
18
+ arguments ?: { name : string ; description ?: string ; required ?: boolean } [ ] ;
22
19
omitPrefix ?: boolean ;
23
20
annotations ?: {
24
21
title ?: string ;
@@ -28,19 +25,12 @@ export interface ServerPrompt<InputSchema extends ZodTypeAny = ZodTypeAny> {
28
25
feature ?: string ;
29
26
} ;
30
27
} ;
31
- fn : ( input : z . infer < InputSchema > , ctx : ServerPromptContext ) => Promise < PromptMessage [ ] > ;
28
+ fn : ( args : Record < string , string > , ctx : ServerPromptContext ) => Promise < PromptMessage [ ] > ;
32
29
}
33
30
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 {
42
32
return {
43
- mcp : { ... options , inputSchema : cleanSchema ( zodToJsonSchema ( options . inputSchema ) ) } ,
33
+ mcp : options ,
44
34
fn,
45
35
} ;
46
36
}
0 commit comments