Skip to content

Commit 19fdacf

Browse files
committed
include desctiption and headers
1 parent 52ebe67 commit 19fdacf

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

genkit-tools/cli/src/mcp/docs.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ async function maybeDownloadDocsBundle() {
5757

5858
interface Doc {
5959
title: string;
60+
description?: string;
6061
text: string;
6162
lang: string;
63+
headers: string;
6264
}
6365

6466
export async function defineDocsTool(server: McpServer) {
@@ -95,10 +97,17 @@ export async function defineDocsTool(server: McpServer) {
9597
Object.keys(documents)
9698
.filter((file) => file.startsWith(language))
9799
.map((file) => {
98-
return ` - ${file} : ${documents[file].title}`;
100+
let fileSummary = ` - File: ${file}\n Title: ${documents[file].title}\n`;
101+
if (documents[file].description) {
102+
fileSummary += ` Description: ${documents[file].description}\n`
103+
}
104+
if (documents[file].headers) {
105+
fileSummary += ` Headers:\n ${documents[file].headers.split('\n').join('\n ')}\n`
106+
}
107+
return fileSummary;
99108
})
100109
.join('\n') +
101-
`\n\nIMPORTANT: Make sure to look up "${language}/models.mdx" file, it contains important details about how to work with models.\n\n`,
110+
`\n\nIMPORTANT: if doing anything more than basic model calling, look up "${language}/models.md" file, it contains important details about how to work with models.\n\n`,
102111
});
103112
} else {
104113
for (const file of files) {

0 commit comments

Comments
 (0)