@nanogpt/mcp 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,42 +1,195 @@
1
1
  /**
2
2
  * nanogpt_web_search tool
3
3
  *
4
- * Search the web for current information.
4
+ * Search the web for current information using multiple providers:
5
+ * - linkup: Default provider, supports standard/deep depth
6
+ * - tavily: Advanced search with answer generation, topic filtering
7
+ * - exa: Neural/semantic search with content extraction
8
+ * - kagi: Privacy-focused search with web/news/search modes
9
+ * - perplexity: AI-powered search with domain/language filtering
5
10
  */
6
11
  import { z } from 'zod';
7
12
  export declare const inputSchema: z.ZodObject<{
8
13
  query: z.ZodString;
9
- depth: z.ZodOptional<z.ZodEnum<["standard", "deep"]>>;
10
- outputType: z.ZodOptional<z.ZodEnum<["searchResults", "sourcedAnswer", "structured"]>>;
11
- structuredOutputSchema: z.ZodOptional<z.ZodString>;
14
+ provider: z.ZodOptional<z.ZodEnum<["linkup", "tavily", "exa", "kagi", "perplexity"]>>;
15
+ depth: z.ZodOptional<z.ZodEnum<["standard", "deep", "fast", "auto", "neural"]>>;
16
+ maxResults: z.ZodOptional<z.ZodNumber>;
12
17
  includeImages: z.ZodOptional<z.ZodBoolean>;
13
18
  fromDate: z.ZodOptional<z.ZodString>;
14
19
  toDate: z.ZodOptional<z.ZodString>;
15
20
  excludeDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
16
21
  includeDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
22
+ outputType: z.ZodOptional<z.ZodEnum<["searchResults", "sourcedAnswer", "structured"]>>;
23
+ structuredOutputSchema: z.ZodOptional<z.ZodString>;
24
+ kagiSource: z.ZodOptional<z.ZodEnum<["web", "news", "search"]>>;
25
+ includeAnswer: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["basic", "advanced"]>]>>;
26
+ includeRawContent: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["markdown", "text"]>]>>;
27
+ topic: z.ZodOptional<z.ZodEnum<["general", "news", "finance"]>>;
28
+ timeRange: z.ZodOptional<z.ZodEnum<["day", "week", "month", "year", "d", "w", "m", "y"]>>;
29
+ chunksPerSource: z.ZodOptional<z.ZodNumber>;
30
+ country: z.ZodOptional<z.ZodString>;
31
+ category: z.ZodOptional<z.ZodEnum<["company", "research paper", "news", "pdf", "github", "tweet", "personal site", "people", "financial report"]>>;
32
+ context: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
33
+ maxCharacters: z.ZodOptional<z.ZodNumber>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ maxCharacters?: number | undefined;
36
+ }, {
37
+ maxCharacters?: number | undefined;
38
+ }>]>>;
39
+ contents: z.ZodOptional<z.ZodObject<{
40
+ text: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
41
+ maxCharacters: z.ZodOptional<z.ZodNumber>;
42
+ includeHtmlTags: z.ZodOptional<z.ZodBoolean>;
43
+ }, "strip", z.ZodTypeAny, {
44
+ maxCharacters?: number | undefined;
45
+ includeHtmlTags?: boolean | undefined;
46
+ }, {
47
+ maxCharacters?: number | undefined;
48
+ includeHtmlTags?: boolean | undefined;
49
+ }>]>>;
50
+ highlights: z.ZodOptional<z.ZodObject<{
51
+ numSentences: z.ZodOptional<z.ZodNumber>;
52
+ highlightsPerUrl: z.ZodOptional<z.ZodNumber>;
53
+ query: z.ZodOptional<z.ZodString>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ query?: string | undefined;
56
+ numSentences?: number | undefined;
57
+ highlightsPerUrl?: number | undefined;
58
+ }, {
59
+ query?: string | undefined;
60
+ numSentences?: number | undefined;
61
+ highlightsPerUrl?: number | undefined;
62
+ }>>;
63
+ summary: z.ZodOptional<z.ZodObject<{
64
+ query: z.ZodOptional<z.ZodString>;
65
+ }, "strip", z.ZodTypeAny, {
66
+ query?: string | undefined;
67
+ }, {
68
+ query?: string | undefined;
69
+ }>>;
70
+ livecrawl: z.ZodOptional<z.ZodEnum<["never", "fallback", "always", "preferred"]>>;
71
+ subpages: z.ZodOptional<z.ZodNumber>;
72
+ }, "strip", z.ZodTypeAny, {
73
+ text?: boolean | {
74
+ maxCharacters?: number | undefined;
75
+ includeHtmlTags?: boolean | undefined;
76
+ } | undefined;
77
+ highlights?: {
78
+ query?: string | undefined;
79
+ numSentences?: number | undefined;
80
+ highlightsPerUrl?: number | undefined;
81
+ } | undefined;
82
+ summary?: {
83
+ query?: string | undefined;
84
+ } | undefined;
85
+ livecrawl?: "never" | "fallback" | "always" | "preferred" | undefined;
86
+ subpages?: number | undefined;
87
+ }, {
88
+ text?: boolean | {
89
+ maxCharacters?: number | undefined;
90
+ includeHtmlTags?: boolean | undefined;
91
+ } | undefined;
92
+ highlights?: {
93
+ query?: string | undefined;
94
+ numSentences?: number | undefined;
95
+ highlightsPerUrl?: number | undefined;
96
+ } | undefined;
97
+ summary?: {
98
+ query?: string | undefined;
99
+ } | undefined;
100
+ livecrawl?: "never" | "fallback" | "always" | "preferred" | undefined;
101
+ subpages?: number | undefined;
102
+ }>>;
103
+ maxTokensPerPage: z.ZodOptional<z.ZodNumber>;
104
+ searchDomainFilter: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
105
+ searchLanguageFilter: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
17
106
  include_raw: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
18
107
  }, "strip", z.ZodTypeAny, {
19
108
  query: string;
20
109
  include_raw: boolean;
21
- depth?: "standard" | "deep" | undefined;
22
- outputType?: "searchResults" | "sourcedAnswer" | "structured" | undefined;
23
- structuredOutputSchema?: string | undefined;
110
+ provider?: "linkup" | "tavily" | "exa" | "kagi" | "perplexity" | undefined;
111
+ depth?: "standard" | "deep" | "fast" | "auto" | "neural" | undefined;
112
+ maxResults?: number | undefined;
24
113
  includeImages?: boolean | undefined;
25
114
  fromDate?: string | undefined;
26
115
  toDate?: string | undefined;
27
116
  excludeDomains?: string[] | undefined;
28
117
  includeDomains?: string[] | undefined;
118
+ outputType?: "searchResults" | "sourcedAnswer" | "structured" | undefined;
119
+ structuredOutputSchema?: string | undefined;
120
+ kagiSource?: "web" | "news" | "search" | undefined;
121
+ includeAnswer?: boolean | "basic" | "advanced" | undefined;
122
+ includeRawContent?: boolean | "text" | "markdown" | undefined;
123
+ topic?: "news" | "general" | "finance" | undefined;
124
+ timeRange?: "day" | "week" | "month" | "year" | "d" | "w" | "m" | "y" | undefined;
125
+ chunksPerSource?: number | undefined;
126
+ country?: string | undefined;
127
+ category?: "news" | "company" | "research paper" | "pdf" | "github" | "tweet" | "personal site" | "people" | "financial report" | undefined;
128
+ context?: boolean | {
129
+ maxCharacters?: number | undefined;
130
+ } | undefined;
131
+ contents?: {
132
+ text?: boolean | {
133
+ maxCharacters?: number | undefined;
134
+ includeHtmlTags?: boolean | undefined;
135
+ } | undefined;
136
+ highlights?: {
137
+ query?: string | undefined;
138
+ numSentences?: number | undefined;
139
+ highlightsPerUrl?: number | undefined;
140
+ } | undefined;
141
+ summary?: {
142
+ query?: string | undefined;
143
+ } | undefined;
144
+ livecrawl?: "never" | "fallback" | "always" | "preferred" | undefined;
145
+ subpages?: number | undefined;
146
+ } | undefined;
147
+ maxTokensPerPage?: number | undefined;
148
+ searchDomainFilter?: string[] | undefined;
149
+ searchLanguageFilter?: string[] | undefined;
29
150
  }, {
30
151
  query: string;
31
152
  include_raw?: boolean | undefined;
32
- depth?: "standard" | "deep" | undefined;
33
- outputType?: "searchResults" | "sourcedAnswer" | "structured" | undefined;
34
- structuredOutputSchema?: string | undefined;
153
+ provider?: "linkup" | "tavily" | "exa" | "kagi" | "perplexity" | undefined;
154
+ depth?: "standard" | "deep" | "fast" | "auto" | "neural" | undefined;
155
+ maxResults?: number | undefined;
35
156
  includeImages?: boolean | undefined;
36
157
  fromDate?: string | undefined;
37
158
  toDate?: string | undefined;
38
159
  excludeDomains?: string[] | undefined;
39
160
  includeDomains?: string[] | undefined;
161
+ outputType?: "searchResults" | "sourcedAnswer" | "structured" | undefined;
162
+ structuredOutputSchema?: string | undefined;
163
+ kagiSource?: "web" | "news" | "search" | undefined;
164
+ includeAnswer?: boolean | "basic" | "advanced" | undefined;
165
+ includeRawContent?: boolean | "text" | "markdown" | undefined;
166
+ topic?: "news" | "general" | "finance" | undefined;
167
+ timeRange?: "day" | "week" | "month" | "year" | "d" | "w" | "m" | "y" | undefined;
168
+ chunksPerSource?: number | undefined;
169
+ country?: string | undefined;
170
+ category?: "news" | "company" | "research paper" | "pdf" | "github" | "tweet" | "personal site" | "people" | "financial report" | undefined;
171
+ context?: boolean | {
172
+ maxCharacters?: number | undefined;
173
+ } | undefined;
174
+ contents?: {
175
+ text?: boolean | {
176
+ maxCharacters?: number | undefined;
177
+ includeHtmlTags?: boolean | undefined;
178
+ } | undefined;
179
+ highlights?: {
180
+ query?: string | undefined;
181
+ numSentences?: number | undefined;
182
+ highlightsPerUrl?: number | undefined;
183
+ } | undefined;
184
+ summary?: {
185
+ query?: string | undefined;
186
+ } | undefined;
187
+ livecrawl?: "never" | "fallback" | "always" | "preferred" | undefined;
188
+ subpages?: number | undefined;
189
+ } | undefined;
190
+ maxTokensPerPage?: number | undefined;
191
+ searchDomainFilter?: string[] | undefined;
192
+ searchLanguageFilter?: string[] | undefined;
40
193
  }>;
41
194
  export declare const outputSchema: z.ZodObject<{
42
195
  data: z.ZodUnknown;
@@ -54,7 +207,7 @@ export declare const outputSchema: z.ZodObject<{
54
207
  export declare const inputJsonSchema: import("../toolUtils.js").JsonSchema;
55
208
  export declare const outputJsonSchema: import("../toolUtils.js").JsonSchema;
56
209
  export declare const name = "nanogpt_web_search";
57
- export declare const description = "Search the web for current information. Returns search results, sourced answers, or structured data.";
210
+ export declare const description = "Search the web using multiple providers. Providers: linkup (default), tavily (AI answers), exa (semantic/neural), kagi (privacy-focused), perplexity (AI-powered). Each provider has unique features - see parameter descriptions.";
58
211
  export declare const annotations: {
59
212
  readOnlyHint: boolean;
60
213
  openWorldHint: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"webSearch.d.ts","sourceRoot":"","sources":["../../src/tools/webSearch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWtB,CAAC;AAGH,eAAO,MAAM,YAAY;;;;;;;;;;;;EAIvB,CAAC;AAGH,eAAO,MAAM,eAAe,sCAA+B,CAAC;AAC5D,eAAO,MAAM,gBAAgB,sCAAgC,CAAC;AAG9D,eAAO,MAAM,IAAI,uBAAuB,CAAC;AACzC,eAAO,MAAM,WAAW,yGACgF,CAAC;AAGzG,eAAO,MAAM,WAAW;;;CAGvB,CAAC;AAcF;;GAEG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,OAAO;;;GA6E1C"}
1
+ {"version":3,"file":"webSearch.d.ts","sourceRoot":"","sources":["../../src/tools/webSearch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2FtB,CAAC;AAGH,eAAO,MAAM,YAAY;;;;;;;;;;;;EAIvB,CAAC;AAGH,eAAO,MAAM,eAAe,sCAA+B,CAAC;AAC5D,eAAO,MAAM,gBAAgB,sCAAgC,CAAC;AAG9D,eAAO,MAAM,IAAI,uBAAuB,CAAC;AACzC,eAAO,MAAM,WAAW,uOAC8M,CAAC;AAGvO,eAAO,MAAM,WAAW;;;CAGvB,CAAC;AAkCF;;GAEG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,OAAO;;;GA6H1C"}
@@ -1,23 +1,100 @@
1
1
  /**
2
2
  * nanogpt_web_search tool
3
3
  *
4
- * Search the web for current information.
4
+ * Search the web for current information using multiple providers:
5
+ * - linkup: Default provider, supports standard/deep depth
6
+ * - tavily: Advanced search with answer generation, topic filtering
7
+ * - exa: Neural/semantic search with content extraction
8
+ * - kagi: Privacy-focused search with web/news/search modes
9
+ * - perplexity: AI-powered search with domain/language filtering
5
10
  */
6
11
  import { z } from 'zod';
7
12
  import { requestJson } from '../httpClient.js';
8
13
  import { handleToolError, processRawResponse, buildContent, zodToJsonSchema } from '../toolUtils.js';
9
- // Input schema
14
+ // Input schema with multi-provider support
10
15
  export const inputSchema = z.object({
11
- query: z.string().min(1),
12
- depth: z.enum(['standard', 'deep']).optional(),
13
- outputType: z.enum(['searchResults', 'sourcedAnswer', 'structured']).optional(),
14
- structuredOutputSchema: z.string().optional(),
15
- includeImages: z.boolean().optional(),
16
- fromDate: z.string().optional(),
17
- toDate: z.string().optional(),
18
- excludeDomains: z.array(z.string()).optional(),
19
- includeDomains: z.array(z.string()).optional(),
20
- include_raw: z.boolean().optional().default(false),
16
+ // Required
17
+ query: z.string().min(1).describe('The search query'),
18
+ // Provider selection
19
+ provider: z.enum(['linkup', 'tavily', 'exa', 'kagi', 'perplexity']).optional()
20
+ .describe('Web search provider to use. Default: linkup'),
21
+ // Common options
22
+ depth: z.enum(['standard', 'deep', 'fast', 'auto', 'neural']).optional()
23
+ .describe('Search depth. fast/auto/neural only for Exa. Default: standard'),
24
+ maxResults: z.number().int().min(1).max(100).optional()
25
+ .describe('Maximum number of results to return'),
26
+ includeImages: z.boolean().optional()
27
+ .describe('Include image results (Linkup, Tavily)'),
28
+ fromDate: z.string().optional()
29
+ .describe('Start date filter (YYYY-MM-DD)'),
30
+ toDate: z.string().optional()
31
+ .describe('End date filter (YYYY-MM-DD)'),
32
+ excludeDomains: z.array(z.string()).optional()
33
+ .describe('Domains to exclude from results'),
34
+ includeDomains: z.array(z.string()).optional()
35
+ .describe('Only include results from these domains'),
36
+ // Linkup-specific
37
+ outputType: z.enum(['searchResults', 'sourcedAnswer', 'structured']).optional()
38
+ .describe('Output format (Linkup only). Default: searchResults'),
39
+ structuredOutputSchema: z.string().optional()
40
+ .describe('JSON schema for structured output (Linkup only, requires outputType=structured)'),
41
+ // Kagi-specific
42
+ kagiSource: z.enum(['web', 'news', 'search']).optional()
43
+ .describe('Kagi search mode: web (enriched), news, or search (full search API)'),
44
+ // Tavily-specific
45
+ includeAnswer: z.union([z.boolean(), z.enum(['basic', 'advanced'])]).optional()
46
+ .describe('Include AI-generated answer (Tavily)'),
47
+ includeRawContent: z.union([z.boolean(), z.enum(['markdown', 'text'])]).optional()
48
+ .describe('Include raw page content (Tavily)'),
49
+ topic: z.enum(['general', 'news', 'finance']).optional()
50
+ .describe('Search topic category (Tavily)'),
51
+ timeRange: z.enum(['day', 'week', 'month', 'year', 'd', 'w', 'm', 'y']).optional()
52
+ .describe('Time range filter (Tavily)'),
53
+ chunksPerSource: z.number().int().min(1).max(3).optional()
54
+ .describe('Chunks per source for deep search (Tavily, depth=deep only)'),
55
+ country: z.string().optional()
56
+ .describe('Country code for localized results (Tavily, Perplexity)'),
57
+ // Exa-specific
58
+ category: z.enum([
59
+ 'company', 'research paper', 'news', 'pdf', 'github',
60
+ 'tweet', 'personal site', 'people', 'financial report'
61
+ ]).optional()
62
+ .describe('Content category filter (Exa)'),
63
+ context: z.union([
64
+ z.boolean(),
65
+ z.object({ maxCharacters: z.number().int().positive().optional() })
66
+ ]).optional()
67
+ .describe('Include surrounding context (Exa)'),
68
+ contents: z.object({
69
+ text: z.union([
70
+ z.boolean(),
71
+ z.object({
72
+ maxCharacters: z.number().int().positive().optional(),
73
+ includeHtmlTags: z.boolean().optional(),
74
+ })
75
+ ]).optional(),
76
+ highlights: z.object({
77
+ numSentences: z.number().int().positive().optional(),
78
+ highlightsPerUrl: z.number().int().positive().optional(),
79
+ query: z.string().optional(),
80
+ }).optional(),
81
+ summary: z.object({
82
+ query: z.string().optional(),
83
+ }).optional(),
84
+ livecrawl: z.enum(['never', 'fallback', 'always', 'preferred']).optional(),
85
+ subpages: z.number().int().min(0).optional(),
86
+ }).optional()
87
+ .describe('Content extraction options (Exa)'),
88
+ // Perplexity-specific
89
+ maxTokensPerPage: z.number().int().positive().optional()
90
+ .describe('Max tokens per page (Perplexity)'),
91
+ searchDomainFilter: z.array(z.string()).optional()
92
+ .describe('Domain allowlist/denylist, prefix with - to exclude (Perplexity)'),
93
+ searchLanguageFilter: z.array(z.string()).optional()
94
+ .describe('ISO 639-1 language codes to filter by (Perplexity)'),
95
+ // Debug
96
+ include_raw: z.boolean().optional().default(false)
97
+ .describe('Include raw API response for debugging'),
21
98
  });
22
99
  // Output schema
23
100
  export const outputSchema = z.object({
@@ -30,7 +107,7 @@ export const inputJsonSchema = zodToJsonSchema(inputSchema);
30
107
  export const outputJsonSchema = zodToJsonSchema(outputSchema);
31
108
  // Tool metadata
32
109
  export const name = 'nanogpt_web_search';
33
- export const description = 'Search the web for current information. Returns search results, sourced answers, or structured data.';
110
+ export const description = 'Search the web using multiple providers. Providers: linkup (default), tavily (AI answers), exa (semantic/neural), kagi (privacy-focused), perplexity (AI-powered). Each provider has unique features - see parameter descriptions.';
34
111
  // Annotations
35
112
  export const annotations = {
36
113
  readOnlyHint: false,
@@ -43,16 +120,18 @@ export async function handler(args) {
43
120
  try {
44
121
  // Validate input
45
122
  const input = inputSchema.parse(args);
46
- // Build request body
123
+ // Build request body with all parameters
47
124
  const requestBody = {
48
125
  query: input.query,
49
126
  };
127
+ // Provider selection
128
+ if (input.provider)
129
+ requestBody.provider = input.provider;
130
+ // Common options
50
131
  if (input.depth)
51
132
  requestBody.depth = input.depth;
52
- if (input.outputType)
53
- requestBody.outputType = input.outputType;
54
- if (input.structuredOutputSchema)
55
- requestBody.structuredOutputSchema = input.structuredOutputSchema;
133
+ if (input.maxResults !== undefined)
134
+ requestBody.maxResults = input.maxResults;
56
135
  if (input.includeImages !== undefined)
57
136
  requestBody.includeImages = input.includeImages;
58
137
  if (input.fromDate)
@@ -63,6 +142,41 @@ export async function handler(args) {
63
142
  requestBody.excludeDomains = input.excludeDomains;
64
143
  if (input.includeDomains)
65
144
  requestBody.includeDomains = input.includeDomains;
145
+ // Linkup-specific
146
+ if (input.outputType)
147
+ requestBody.outputType = input.outputType;
148
+ if (input.structuredOutputSchema)
149
+ requestBody.structuredOutputSchema = input.structuredOutputSchema;
150
+ // Kagi-specific
151
+ if (input.kagiSource)
152
+ requestBody.kagiSource = input.kagiSource;
153
+ // Tavily-specific
154
+ if (input.includeAnswer !== undefined)
155
+ requestBody.includeAnswer = input.includeAnswer;
156
+ if (input.includeRawContent !== undefined)
157
+ requestBody.includeRawContent = input.includeRawContent;
158
+ if (input.topic)
159
+ requestBody.topic = input.topic;
160
+ if (input.timeRange)
161
+ requestBody.timeRange = input.timeRange;
162
+ if (input.chunksPerSource !== undefined)
163
+ requestBody.chunksPerSource = input.chunksPerSource;
164
+ if (input.country)
165
+ requestBody.country = input.country;
166
+ // Exa-specific
167
+ if (input.category)
168
+ requestBody.category = input.category;
169
+ if (input.context !== undefined)
170
+ requestBody.context = input.context;
171
+ if (input.contents)
172
+ requestBody.contents = input.contents;
173
+ // Perplexity-specific
174
+ if (input.maxTokensPerPage !== undefined)
175
+ requestBody.maxTokensPerPage = input.maxTokensPerPage;
176
+ if (input.searchDomainFilter)
177
+ requestBody.searchDomainFilter = input.searchDomainFilter;
178
+ if (input.searchLanguageFilter)
179
+ requestBody.searchLanguageFilter = input.searchLanguageFilter;
66
180
  // Call NanoGPT API - web search can take up to 5 minutes
67
181
  const response = await requestJson({
68
182
  method: 'POST',
@@ -71,11 +185,21 @@ export async function handler(args) {
71
185
  timeoutMs: 300000, // 5 minutes
72
186
  });
73
187
  const data = response.json;
74
- // Build output
188
+ const provider = data.metadata?.provider || input.provider || 'linkup';
189
+ // Build output with provider-specific extras
75
190
  const output = {
76
191
  data: data.data,
77
192
  metadata: data.metadata || {},
78
193
  };
194
+ // Include provider-specific response data
195
+ if (data.tavily)
196
+ output.tavily = data.tavily;
197
+ if (data.exa)
198
+ output.exa = data.exa;
199
+ if (data.kagi)
200
+ output.kagi = data.kagi;
201
+ if (data.perplexity)
202
+ output.perplexity = data.perplexity;
79
203
  // Process raw response
80
204
  const { raw, resourceLink } = processRawResponse({ status: response.status, headers: response.headers, body: data }, input.include_raw);
81
205
  if (raw !== undefined) {
@@ -84,8 +208,15 @@ export async function handler(args) {
84
208
  // Build human-readable content
85
209
  let displayText;
86
210
  const resultData = data.data;
211
+ const providerLabel = provider.charAt(0).toUpperCase() + provider.slice(1);
87
212
  if (Array.isArray(resultData)) {
88
- displayText = `Found ${resultData.length} result(s) for: "${input.query}"`;
213
+ displayText = `[${providerLabel}] Found ${resultData.length} result(s) for: "${input.query}"`;
214
+ // Show Tavily answer if present
215
+ if (data.tavily?.answer) {
216
+ displayText += `\n\nAnswer: ${String(data.tavily.answer).slice(0, 300)}`;
217
+ if (String(data.tavily.answer).length > 300)
218
+ displayText += '...';
219
+ }
89
220
  // Add first few results as preview
90
221
  const preview = resultData.slice(0, 3);
91
222
  for (const item of preview) {
@@ -103,10 +234,14 @@ export async function handler(args) {
103
234
  }
104
235
  }
105
236
  else if (typeof resultData === 'object' && resultData !== null) {
106
- displayText = `Search completed for: "${input.query}"\n${JSON.stringify(resultData, null, 2).slice(0, 500)}`;
237
+ displayText = `[${providerLabel}] Search completed for: "${input.query}"\n${JSON.stringify(resultData, null, 2).slice(0, 500)}`;
107
238
  }
108
239
  else {
109
- displayText = `Search completed for: "${input.query}"`;
240
+ displayText = `[${providerLabel}] Search completed for: "${input.query}"`;
241
+ }
242
+ // Add cost info if available
243
+ if (data.metadata?.cost !== undefined && data.metadata.cost > 0) {
244
+ displayText += `\n\nCost: $${data.metadata.cost.toFixed(4)}`;
110
245
  }
111
246
  return {
112
247
  content: build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CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;QAClI,CAAC;aAAM,CAAC;YACN,WAAW,GAAG,IAAI,aAAa,4BAA4B,KAAK,CAAC,KAAK,GAAG,CAAC;QAC5E,CAAC;QAED,6BAA6B;QAC7B,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YAChE,WAAW,IAAI,cAAc,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/D,CAAC;QAED,OAAO;YACL,OAAO,EAAE,YAAY,CAAC,WAAW,EAAE,YAAY,CAAC;YAChD,iBAAiB,EAAE,MAAM;SAC1B,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,15 +1,8 @@
1
1
  {
2
2
  "name": "@nanogpt/mcp",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "MCP server for NanoGPT API integration",
5
5
  "type": "module",
6
- "publishConfig": {
7
- "access": "public"
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/Nano-GPT-com/nanogpt-mcp.git"
12
- },
13
6
  "engines": {
14
7
  "node": ">=22"
15
8
  },
@@ -19,22 +12,26 @@
19
12
  },
20
13
  "scripts": {
21
14
  "build": "tsc",
22
- "prepublishOnly": "npm run build",
23
15
  "start": "node dist/index.js",
24
16
  "dev": "tsc --watch",
25
17
  "test": "node --test tests/*.test.js",
26
18
  "typecheck": "tsc --noEmit"
27
19
  },
28
20
  "dependencies": {
29
- "@modelcontextprotocol/sdk": "^1.24.3",
30
- "zod": "^3.23.8",
31
- "lru-cache": "^11.0.2",
32
- "undici": "^5.28.4"
21
+ "@modelcontextprotocol/sdk": "^1.25.2",
22
+ "zod": "^3.25.76",
23
+ "lru-cache": "^11.0.2"
33
24
  },
34
25
  "devDependencies": {
35
26
  "@types/node": "^22.10.2",
36
27
  "typescript": "^5.7.2"
37
28
  },
29
+ "overrides": {
30
+ "qs": "^6.14.1"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
38
35
  "files": [
39
36
  "dist/**/*"
40
37
  ],
@@ -1,78 +0,0 @@
1
- /**
2
- * nanogpt_vision tool
3
- *
4
- * Analyze images with a vision-capable model (default: zai-org/glm-4.6v).
5
- */
6
- import { z } from 'zod';
7
- export declare const inputSchema: z.ZodObject<{
8
- prompt: z.ZodString;
9
- image_url: z.ZodOptional<z.ZodString>;
10
- image_urls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
11
- image_data_url: z.ZodOptional<z.ZodString>;
12
- image_data_urls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13
- image_detail: z.ZodOptional<z.ZodEnum<["low", "high", "auto"]>>;
14
- model: z.ZodOptional<z.ZodString>;
15
- temperature: z.ZodOptional<z.ZodNumber>;
16
- max_tokens: z.ZodOptional<z.ZodNumber>;
17
- include_usage: z.ZodOptional<z.ZodBoolean>;
18
- system_prompt: z.ZodOptional<z.ZodString>;
19
- include_raw: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
20
- }, "strip", z.ZodTypeAny, {
21
- include_raw: boolean;
22
- prompt: string;
23
- model?: string | undefined;
24
- temperature?: number | undefined;
25
- max_tokens?: number | undefined;
26
- include_usage?: boolean | undefined;
27
- image_url?: string | undefined;
28
- image_urls?: string[] | undefined;
29
- image_data_url?: string | undefined;
30
- image_data_urls?: string[] | undefined;
31
- image_detail?: "low" | "high" | "auto" | undefined;
32
- system_prompt?: string | undefined;
33
- }, {
34
- prompt: string;
35
- include_raw?: boolean | undefined;
36
- model?: string | undefined;
37
- temperature?: number | undefined;
38
- max_tokens?: number | undefined;
39
- include_usage?: boolean | undefined;
40
- image_url?: string | undefined;
41
- image_urls?: string[] | undefined;
42
- image_data_url?: string | undefined;
43
- image_data_urls?: string[] | undefined;
44
- image_detail?: "low" | "high" | "auto" | undefined;
45
- system_prompt?: string | undefined;
46
- }>;
47
- export declare const outputSchema: z.ZodObject<{
48
- content: z.ZodString;
49
- message: z.ZodRecord<z.ZodString, z.ZodUnknown>;
50
- usage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
51
- raw: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodString]>>;
52
- }, "strip", z.ZodTypeAny, {
53
- message: Record<string, unknown>;
54
- content: string;
55
- raw?: string | Record<string, unknown> | undefined;
56
- usage?: Record<string, unknown> | undefined;
57
- }, {
58
- message: Record<string, unknown>;
59
- content: string;
60
- raw?: string | Record<string, unknown> | undefined;
61
- usage?: Record<string, unknown> | undefined;
62
- }>;
63
- export declare const inputJsonSchema: import("../toolUtils.js").JsonSchema;
64
- export declare const outputJsonSchema: import("../toolUtils.js").JsonSchema;
65
- export declare const name = "nanogpt_vision";
66
- export declare const description = "Analyze images with a vision-capable model. Provide an image URL or data URL plus a prompt.";
67
- export declare const annotations: {
68
- readOnlyHint: boolean;
69
- openWorldHint: boolean;
70
- };
71
- /**
72
- * Handler for nanogpt_vision
73
- */
74
- export declare function handler(args: unknown): Promise<{
75
- content: import("../toolUtils.js").ContentItem[];
76
- structuredContent: Record<string, unknown>;
77
- }>;
78
- //# sourceMappingURL=vision.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vision.d.ts","sourceRoot":"","sources":["../../src/tools/vision.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAatB,CAAC;AAGH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;EAKvB,CAAC;AAGH,eAAO,MAAM,eAAe,sCAA+B,CAAC;AAC5D,eAAO,MAAM,gBAAgB,sCAAgC,CAAC;AAG9D,eAAO,MAAM,IAAI,mBAAmB,CAAC;AACrC,eAAO,MAAM,WAAW,gGACuE,CAAC;AAGhG,eAAO,MAAM,WAAW;;;CAGvB,CAAC;AAiBF;;GAEG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,OAAO;;;GA8H1C"}