@perplexity-ai/mcp-server 0.2.2 → 0.13.0
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.
- package/LICENSE +201 -21
- package/README.md +169 -73
- package/compat.d.mts +58 -0
- package/compat.d.mts.map +1 -0
- package/compat.d.ts +58 -0
- package/compat.d.ts.map +1 -0
- package/compat.js +387 -0
- package/compat.js.map +1 -0
- package/compat.mjs +378 -0
- package/compat.mjs.map +1 -0
- package/dynamic-tools.d.mts +12 -0
- package/dynamic-tools.d.mts.map +1 -0
- package/dynamic-tools.d.ts +12 -0
- package/dynamic-tools.d.ts.map +1 -0
- package/dynamic-tools.js +135 -0
- package/dynamic-tools.js.map +1 -0
- package/dynamic-tools.mjs +132 -0
- package/dynamic-tools.mjs.map +1 -0
- package/filtering.d.mts +2 -0
- package/filtering.d.mts.map +1 -0
- package/filtering.d.ts +2 -0
- package/filtering.d.ts.map +1 -0
- package/filtering.js +20 -0
- package/filtering.js.map +1 -0
- package/filtering.mjs +13 -0
- package/filtering.mjs.map +1 -0
- package/headers.d.mts +4 -0
- package/headers.d.mts.map +1 -0
- package/headers.d.ts +4 -0
- package/headers.d.ts.map +1 -0
- package/headers.js +22 -0
- package/headers.js.map +1 -0
- package/headers.mjs +18 -0
- package/headers.mjs.map +1 -0
- package/http.d.mts +9 -0
- package/http.d.mts.map +1 -0
- package/http.d.ts +9 -0
- package/http.d.ts.map +1 -0
- package/http.js +108 -0
- package/http.js.map +1 -0
- package/http.mjs +100 -0
- package/http.mjs.map +1 -0
- package/index.d.mts +3 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +91 -0
- package/index.js.map +1 -0
- package/index.mjs +89 -0
- package/index.mjs.map +1 -0
- package/options.d.mts +18 -0
- package/options.d.mts.map +1 -0
- package/options.d.ts +18 -0
- package/options.d.ts.map +1 -0
- package/options.js +415 -0
- package/options.js.map +1 -0
- package/options.mjs +408 -0
- package/options.mjs.map +1 -0
- package/package.json +156 -37
- package/server.d.mts +35 -0
- package/server.d.mts.map +1 -0
- package/server.d.ts +35 -0
- package/server.d.ts.map +1 -0
- package/server.js +166 -0
- package/server.js.map +1 -0
- package/server.mjs +152 -0
- package/server.mjs.map +1 -0
- package/src/compat.ts +483 -0
- package/src/dynamic-tools.ts +159 -0
- package/src/filtering.ts +14 -0
- package/src/headers.ts +23 -0
- package/src/http.ts +127 -0
- package/src/index.ts +108 -0
- package/src/options.ts +453 -0
- package/src/server.ts +201 -0
- package/src/stdio.ts +13 -0
- package/src/tools/chat/completions/create-chat-completions.ts +1360 -0
- package/src/tools/index.ts +73 -0
- package/src/tools/search/create-search.ts +89 -0
- package/src/tools/types.ts +103 -0
- package/src/tools.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/stdio.d.mts +3 -0
- package/stdio.d.mts.map +1 -0
- package/stdio.d.ts +3 -0
- package/stdio.d.ts.map +1 -0
- package/stdio.js +14 -0
- package/stdio.js.map +1 -0
- package/stdio.mjs +10 -0
- package/stdio.mjs.map +1 -0
- package/tools/chat/completions/create-chat-completions.d.mts +45 -0
- package/tools/chat/completions/create-chat-completions.d.mts.map +1 -0
- package/tools/chat/completions/create-chat-completions.d.ts +45 -0
- package/tools/chat/completions/create-chat-completions.d.ts.map +1 -0
- package/tools/chat/completions/create-chat-completions.js +1357 -0
- package/tools/chat/completions/create-chat-completions.js.map +1 -0
- package/tools/chat/completions/create-chat-completions.mjs +1353 -0
- package/tools/chat/completions/create-chat-completions.mjs.map +1 -0
- package/tools/index.d.mts +10 -0
- package/tools/index.d.mts.map +1 -0
- package/tools/index.d.ts +10 -0
- package/tools/index.d.ts.map +1 -0
- package/tools/index.js +57 -0
- package/tools/index.js.map +1 -0
- package/tools/index.mjs +50 -0
- package/tools/index.mjs.map +1 -0
- package/tools/search/create-search.d.mts +45 -0
- package/tools/search/create-search.d.mts.map +1 -0
- package/tools/search/create-search.d.ts +45 -0
- package/tools/search/create-search.d.ts.map +1 -0
- package/tools/search/create-search.js +86 -0
- package/tools/search/create-search.js.map +1 -0
- package/tools/search/create-search.mjs +82 -0
- package/tools/search/create-search.mjs.map +1 -0
- package/tools/types.d.mts +51 -0
- package/tools/types.d.mts.map +1 -0
- package/tools/types.d.ts +51 -0
- package/tools/types.d.ts.map +1 -0
- package/tools/types.js +46 -0
- package/tools/types.js.map +1 -0
- package/tools/types.mjs +42 -0
- package/tools/types.mjs.map +1 -0
- package/tools.d.mts +2 -0
- package/tools.d.mts.map +1 -0
- package/tools.d.ts +2 -0
- package/tools.d.ts.map +1 -0
- package/tools.js +18 -0
- package/tools.js.map +1 -0
- package/tools.mjs +2 -0
- package/tools.mjs.map +1 -0
- package/dist/index.js +0 -446
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { Metadata, Endpoint, HandlerFunction } from './types';
|
|
4
|
+
|
|
5
|
+
export { Metadata, Endpoint, HandlerFunction };
|
|
6
|
+
|
|
7
|
+
import create_chat_completions from './chat/completions/create-chat-completions';
|
|
8
|
+
import create_search from './search/create-search';
|
|
9
|
+
|
|
10
|
+
export const endpoints: Endpoint[] = [];
|
|
11
|
+
|
|
12
|
+
function addEndpoint(endpoint: Endpoint) {
|
|
13
|
+
endpoints.push(endpoint);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
addEndpoint(create_chat_completions);
|
|
17
|
+
addEndpoint(create_search);
|
|
18
|
+
|
|
19
|
+
export type Filter = {
|
|
20
|
+
type: 'resource' | 'operation' | 'tag' | 'tool';
|
|
21
|
+
op: 'include' | 'exclude';
|
|
22
|
+
value: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export function query(filters: Filter[], endpoints: Endpoint[]): Endpoint[] {
|
|
26
|
+
const allExcludes = filters.length > 0 && filters.every((filter) => filter.op === 'exclude');
|
|
27
|
+
const unmatchedFilters = new Set(filters);
|
|
28
|
+
|
|
29
|
+
const filtered = endpoints.filter((endpoint: Endpoint) => {
|
|
30
|
+
let included = false || allExcludes;
|
|
31
|
+
|
|
32
|
+
for (const filter of filters) {
|
|
33
|
+
if (match(filter, endpoint)) {
|
|
34
|
+
unmatchedFilters.delete(filter);
|
|
35
|
+
included = filter.op === 'include';
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return included;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// Check if any filters didn't match
|
|
43
|
+
const unmatched = Array.from(unmatchedFilters).filter((f) => f.type === 'tool' || f.type === 'resource');
|
|
44
|
+
if (unmatched.length > 0) {
|
|
45
|
+
throw new Error(
|
|
46
|
+
`The following filters did not match any endpoints: ${unmatched
|
|
47
|
+
.map((f) => `${f.type}=${f.value}`)
|
|
48
|
+
.join(', ')}`,
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return filtered;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function match({ type, value }: Filter, endpoint: Endpoint): boolean {
|
|
56
|
+
switch (type) {
|
|
57
|
+
case 'resource': {
|
|
58
|
+
const regexStr = '^' + normalizeResource(value).replace(/\*/g, '.*') + '$';
|
|
59
|
+
const regex = new RegExp(regexStr);
|
|
60
|
+
return regex.test(normalizeResource(endpoint.metadata.resource));
|
|
61
|
+
}
|
|
62
|
+
case 'operation':
|
|
63
|
+
return endpoint.metadata.operation === value;
|
|
64
|
+
case 'tag':
|
|
65
|
+
return endpoint.metadata.tags.includes(value);
|
|
66
|
+
case 'tool':
|
|
67
|
+
return endpoint.tool.name === value;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function normalizeResource(resource: string): string {
|
|
72
|
+
return resource.toLowerCase().replace(/[^a-z.*\-_]*/g, '');
|
|
73
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { Metadata, asTextContentResult } from '@perplexity-ai/mcp-server/tools/types';
|
|
4
|
+
|
|
5
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
6
|
+
import Perplexity from '@perplexity-ai/perplexity_ai';
|
|
7
|
+
|
|
8
|
+
export const metadata: Metadata = {
|
|
9
|
+
resource: 'search',
|
|
10
|
+
operation: 'write',
|
|
11
|
+
tags: [],
|
|
12
|
+
httpMethod: 'post',
|
|
13
|
+
httpPath: '/search',
|
|
14
|
+
operationId: 'search_search_post',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const tool: Tool = {
|
|
18
|
+
name: 'create_search',
|
|
19
|
+
description: 'Search the web and retrieve relevant web page contents.',
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: 'object',
|
|
22
|
+
properties: {
|
|
23
|
+
query: {
|
|
24
|
+
anyOf: [
|
|
25
|
+
{
|
|
26
|
+
type: 'string',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: 'array',
|
|
30
|
+
items: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
title: 'Query',
|
|
36
|
+
},
|
|
37
|
+
display_server_time: {
|
|
38
|
+
type: 'boolean',
|
|
39
|
+
title: 'Display Server Time',
|
|
40
|
+
},
|
|
41
|
+
max_results: {
|
|
42
|
+
type: 'integer',
|
|
43
|
+
title: 'Max Results',
|
|
44
|
+
},
|
|
45
|
+
max_tokens: {
|
|
46
|
+
type: 'integer',
|
|
47
|
+
title: 'Max Tokens',
|
|
48
|
+
},
|
|
49
|
+
max_tokens_per_page: {
|
|
50
|
+
type: 'integer',
|
|
51
|
+
title: 'Max Tokens Per Page',
|
|
52
|
+
},
|
|
53
|
+
search_after_date_filter: {
|
|
54
|
+
type: 'string',
|
|
55
|
+
title: 'Search After Date Filter',
|
|
56
|
+
},
|
|
57
|
+
search_before_date_filter: {
|
|
58
|
+
type: 'string',
|
|
59
|
+
title: 'Search Before Date Filter',
|
|
60
|
+
},
|
|
61
|
+
search_domain_filter: {
|
|
62
|
+
type: 'array',
|
|
63
|
+
title: 'Search Domain Filter',
|
|
64
|
+
items: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
search_mode: {
|
|
69
|
+
type: 'string',
|
|
70
|
+
title: 'Search Mode',
|
|
71
|
+
enum: ['web', 'academic', 'sec'],
|
|
72
|
+
},
|
|
73
|
+
search_recency_filter: {
|
|
74
|
+
type: 'string',
|
|
75
|
+
title: 'Search Recency Filter',
|
|
76
|
+
enum: ['hour', 'day', 'week', 'month', 'year'],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
required: ['query'],
|
|
80
|
+
},
|
|
81
|
+
annotations: {},
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const handler = async (client: Perplexity, args: Record<string, unknown> | undefined) => {
|
|
85
|
+
const body = args as any;
|
|
86
|
+
return asTextContentResult(await client.search.create(body));
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export default { metadata, tool, handler };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import Perplexity from '@perplexity-ai/perplexity_ai';
|
|
4
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
+
|
|
6
|
+
type TextContentBlock = {
|
|
7
|
+
type: 'text';
|
|
8
|
+
text: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type ImageContentBlock = {
|
|
12
|
+
type: 'image';
|
|
13
|
+
data: string;
|
|
14
|
+
mimeType: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type AudioContentBlock = {
|
|
18
|
+
type: 'audio';
|
|
19
|
+
data: string;
|
|
20
|
+
mimeType: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
type ResourceContentBlock = {
|
|
24
|
+
type: 'resource';
|
|
25
|
+
resource:
|
|
26
|
+
| {
|
|
27
|
+
uri: string;
|
|
28
|
+
mimeType: string;
|
|
29
|
+
text: string;
|
|
30
|
+
}
|
|
31
|
+
| {
|
|
32
|
+
uri: string;
|
|
33
|
+
mimeType: string;
|
|
34
|
+
blob: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type ContentBlock = TextContentBlock | ImageContentBlock | AudioContentBlock | ResourceContentBlock;
|
|
39
|
+
|
|
40
|
+
export type ToolCallResult = {
|
|
41
|
+
content: ContentBlock[];
|
|
42
|
+
isError?: boolean;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export type HandlerFunction = (
|
|
46
|
+
client: Perplexity,
|
|
47
|
+
args: Record<string, unknown> | undefined,
|
|
48
|
+
) => Promise<ToolCallResult>;
|
|
49
|
+
|
|
50
|
+
export function asTextContentResult(result: unknown): ToolCallResult {
|
|
51
|
+
return {
|
|
52
|
+
content: [
|
|
53
|
+
{
|
|
54
|
+
type: 'text',
|
|
55
|
+
text: JSON.stringify(result, null, 2),
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export async function asBinaryContentResult(response: Response): Promise<ToolCallResult> {
|
|
62
|
+
const blob = await response.blob();
|
|
63
|
+
const mimeType = blob.type;
|
|
64
|
+
const data = Buffer.from(await blob.arrayBuffer()).toString('base64');
|
|
65
|
+
if (mimeType.startsWith('image/')) {
|
|
66
|
+
return {
|
|
67
|
+
content: [{ type: 'image', mimeType, data }],
|
|
68
|
+
};
|
|
69
|
+
} else if (mimeType.startsWith('audio/')) {
|
|
70
|
+
return {
|
|
71
|
+
content: [{ type: 'audio', mimeType, data }],
|
|
72
|
+
};
|
|
73
|
+
} else {
|
|
74
|
+
return {
|
|
75
|
+
content: [
|
|
76
|
+
{
|
|
77
|
+
type: 'resource',
|
|
78
|
+
resource: {
|
|
79
|
+
// We must give a URI, even though this isn't actually an MCP resource.
|
|
80
|
+
uri: 'resource://tool-response',
|
|
81
|
+
mimeType,
|
|
82
|
+
blob: data,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type Metadata = {
|
|
91
|
+
resource: string;
|
|
92
|
+
operation: 'read' | 'write';
|
|
93
|
+
tags: string[];
|
|
94
|
+
httpMethod?: string;
|
|
95
|
+
httpPath?: string;
|
|
96
|
+
operationId?: string;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export type Endpoint = {
|
|
100
|
+
metadata: Metadata;
|
|
101
|
+
tool: Tool;
|
|
102
|
+
handler: HandlerFunction;
|
|
103
|
+
};
|
package/src/tools.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tools/index';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
// this config is included in the published src directory to prevent TS errors
|
|
3
|
+
// from appearing when users go to source, and VSCode opens the source .ts file
|
|
4
|
+
// via declaration maps
|
|
5
|
+
"include": ["index.ts"],
|
|
6
|
+
"compilerOptions": {
|
|
7
|
+
"target": "es2015",
|
|
8
|
+
"lib": ["DOM"],
|
|
9
|
+
"moduleResolution": "node"
|
|
10
|
+
}
|
|
11
|
+
}
|
package/stdio.d.mts
ADDED
package/stdio.d.mts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio.d.mts","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OAEO,EAAE,UAAU,EAAE;AAErB,eAAO,MAAM,iBAAiB,GAAU,SAAS,UAAU,kBAQ1D,CAAC"}
|
package/stdio.d.ts
ADDED
package/stdio.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OAEO,EAAE,UAAU,EAAE;AAErB,eAAO,MAAM,iBAAiB,GAAU,SAAS,UAAU,kBAQ1D,CAAC"}
|
package/stdio.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.launchStdioServer = void 0;
|
|
4
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
5
|
+
const server_1 = require("./server.js");
|
|
6
|
+
const launchStdioServer = async (options) => {
|
|
7
|
+
const server = (0, server_1.newMcpServer)();
|
|
8
|
+
(0, server_1.initMcpServer)({ server, mcpOptions: options });
|
|
9
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
10
|
+
await server.connect(transport);
|
|
11
|
+
console.error('MCP Server running on stdio');
|
|
12
|
+
};
|
|
13
|
+
exports.launchStdioServer = launchStdioServer;
|
|
14
|
+
//# sourceMappingURL=stdio.js.map
|
package/stdio.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio.js","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":";;;AAAA,wEAAiF;AACjF,wCAAuD;AAGhD,MAAM,iBAAiB,GAAG,KAAK,EAAE,OAAmB,EAAE,EAAE;IAC7D,MAAM,MAAM,GAAG,IAAA,qBAAY,GAAE,CAAC;IAE9B,IAAA,sBAAa,EAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;IAE/C,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;AAC/C,CAAC,CAAC;AARW,QAAA,iBAAiB,qBAQ5B"}
|
package/stdio.mjs
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
2
|
+
import { initMcpServer, newMcpServer } from "./server.mjs";
|
|
3
|
+
export const launchStdioServer = async (options) => {
|
|
4
|
+
const server = newMcpServer();
|
|
5
|
+
initMcpServer({ server, mcpOptions: options });
|
|
6
|
+
const transport = new StdioServerTransport();
|
|
7
|
+
await server.connect(transport);
|
|
8
|
+
console.error('MCP Server running on stdio');
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=stdio.mjs.map
|
package/stdio.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio.mjs","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C;OACzE,EAAE,aAAa,EAAE,YAAY,EAAE;AAGtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,OAAmB,EAAE,EAAE;IAC7D,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAE9B,aAAa,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;IAE/C,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;AAC/C,CAAC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Metadata } from '@perplexity-ai/mcp-server/tools/types';
|
|
2
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import Perplexity from '@perplexity-ai/perplexity_ai';
|
|
4
|
+
export declare const metadata: Metadata;
|
|
5
|
+
export declare const tool: Tool;
|
|
6
|
+
export declare const handler: (client: Perplexity, args: Record<string, unknown> | undefined) => Promise<import("@perplexity-ai/mcp-server/tools/types").ToolCallResult>;
|
|
7
|
+
declare const _default: {
|
|
8
|
+
metadata: Metadata;
|
|
9
|
+
tool: {
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
name: string;
|
|
12
|
+
inputSchema: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
type: "object";
|
|
15
|
+
properties?: {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
} | undefined;
|
|
18
|
+
required?: string[] | undefined;
|
|
19
|
+
};
|
|
20
|
+
title?: string | undefined;
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
outputSchema?: {
|
|
23
|
+
[x: string]: unknown;
|
|
24
|
+
type: "object";
|
|
25
|
+
properties?: {
|
|
26
|
+
[x: string]: unknown;
|
|
27
|
+
} | undefined;
|
|
28
|
+
required?: string[] | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
annotations?: {
|
|
31
|
+
[x: string]: unknown;
|
|
32
|
+
title?: string | undefined;
|
|
33
|
+
readOnlyHint?: boolean | undefined;
|
|
34
|
+
destructiveHint?: boolean | undefined;
|
|
35
|
+
idempotentHint?: boolean | undefined;
|
|
36
|
+
openWorldHint?: boolean | undefined;
|
|
37
|
+
} | undefined;
|
|
38
|
+
_meta?: {
|
|
39
|
+
[x: string]: unknown;
|
|
40
|
+
} | undefined;
|
|
41
|
+
};
|
|
42
|
+
handler: (client: Perplexity, args: Record<string, unknown> | undefined) => Promise<import("@perplexity-ai/mcp-server/tools/types").ToolCallResult>;
|
|
43
|
+
};
|
|
44
|
+
export default _default;
|
|
45
|
+
//# sourceMappingURL=create-chat-completions.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-chat-completions.d.mts","sourceRoot":"","sources":["../../../src/tools/chat/completions/create-chat-completions.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAuB,MAAM,uCAAuC;OAE9E,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,UAAU,MAAM,8BAA8B;AAErD,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAwzClB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,UAAU,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,4EAG1F,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,UAAU,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAK3F,wBAA2C"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Metadata } from '@perplexity-ai/mcp-server/tools/types';
|
|
2
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import Perplexity from '@perplexity-ai/perplexity_ai';
|
|
4
|
+
export declare const metadata: Metadata;
|
|
5
|
+
export declare const tool: Tool;
|
|
6
|
+
export declare const handler: (client: Perplexity, args: Record<string, unknown> | undefined) => Promise<import("@perplexity-ai/mcp-server/tools/types").ToolCallResult>;
|
|
7
|
+
declare const _default: {
|
|
8
|
+
metadata: Metadata;
|
|
9
|
+
tool: {
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
name: string;
|
|
12
|
+
inputSchema: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
type: "object";
|
|
15
|
+
properties?: {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
} | undefined;
|
|
18
|
+
required?: string[] | undefined;
|
|
19
|
+
};
|
|
20
|
+
title?: string | undefined;
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
outputSchema?: {
|
|
23
|
+
[x: string]: unknown;
|
|
24
|
+
type: "object";
|
|
25
|
+
properties?: {
|
|
26
|
+
[x: string]: unknown;
|
|
27
|
+
} | undefined;
|
|
28
|
+
required?: string[] | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
annotations?: {
|
|
31
|
+
[x: string]: unknown;
|
|
32
|
+
title?: string | undefined;
|
|
33
|
+
readOnlyHint?: boolean | undefined;
|
|
34
|
+
destructiveHint?: boolean | undefined;
|
|
35
|
+
idempotentHint?: boolean | undefined;
|
|
36
|
+
openWorldHint?: boolean | undefined;
|
|
37
|
+
} | undefined;
|
|
38
|
+
_meta?: {
|
|
39
|
+
[x: string]: unknown;
|
|
40
|
+
} | undefined;
|
|
41
|
+
};
|
|
42
|
+
handler: (client: Perplexity, args: Record<string, unknown> | undefined) => Promise<import("@perplexity-ai/mcp-server/tools/types").ToolCallResult>;
|
|
43
|
+
};
|
|
44
|
+
export default _default;
|
|
45
|
+
//# sourceMappingURL=create-chat-completions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-chat-completions.d.ts","sourceRoot":"","sources":["../../../src/tools/chat/completions/create-chat-completions.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAuB,MAAM,uCAAuC;OAE9E,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,UAAU,MAAM,8BAA8B;AAErD,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAwzClB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,UAAU,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,4EAG1F,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,UAAU,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAK3F,wBAA2C"}
|