profound-mcp 0.2.1
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 -0
- package/README.md +231 -0
- package/code-tool-paths.cjs +6 -0
- package/code-tool-paths.cjs.map +1 -0
- package/code-tool-paths.d.cts +2 -0
- package/code-tool-paths.d.cts.map +1 -0
- package/code-tool-types.d.mts +14 -0
- package/code-tool-types.d.mts.map +1 -0
- package/code-tool-types.d.ts +14 -0
- package/code-tool-types.d.ts.map +1 -0
- package/code-tool-types.js +4 -0
- package/code-tool-types.js.map +1 -0
- package/code-tool-types.mjs +3 -0
- package/code-tool-types.mjs.map +1 -0
- package/code-tool-worker.d.mts +5 -0
- package/code-tool-worker.d.mts.map +1 -0
- package/code-tool-worker.d.ts +5 -0
- package/code-tool-worker.d.ts.map +1 -0
- package/code-tool-worker.js +45 -0
- package/code-tool-worker.js.map +1 -0
- package/code-tool-worker.mjs +40 -0
- package/code-tool-worker.mjs.map +1 -0
- package/code-tool.d.mts +12 -0
- package/code-tool.d.mts.map +1 -0
- package/code-tool.d.ts +12 -0
- package/code-tool.d.ts.map +1 -0
- package/code-tool.js +157 -0
- package/code-tool.js.map +1 -0
- package/code-tool.mjs +121 -0
- package/code-tool.mjs.map +1 -0
- 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/docs-search-tool.d.mts +44 -0
- package/docs-search-tool.d.mts.map +1 -0
- package/docs-search-tool.d.ts +44 -0
- package/docs-search-tool.d.ts.map +1 -0
- package/docs-search-tool.js +43 -0
- package/docs-search-tool.js.map +1 -0
- package/docs-search-tool.mjs +39 -0
- package/docs-search-tool.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 +10 -0
- package/headers.js.map +1 -0
- package/headers.mjs +6 -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 +20 -0
- package/options.d.mts.map +1 -0
- package/options.d.ts +20 -0
- package/options.d.ts.map +1 -0
- package/options.js +424 -0
- package/options.js.map +1 -0
- package/options.mjs +417 -0
- package/options.mjs.map +1 -0
- package/package.json +216 -0
- 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 +174 -0
- package/server.js.map +1 -0
- package/server.mjs +160 -0
- package/server.mjs.map +1 -0
- package/src/code-tool-paths.cts +3 -0
- package/src/code-tool-types.ts +14 -0
- package/src/code-tool-worker.ts +46 -0
- package/src/code-tool.ts +146 -0
- package/src/compat.ts +483 -0
- package/src/docs-search-tool.ts +48 -0
- package/src/dynamic-tools.ts +153 -0
- package/src/filtering.ts +14 -0
- package/src/headers.ts +10 -0
- package/src/http.ts +127 -0
- package/src/index.ts +108 -0
- package/src/options.ts +466 -0
- package/src/server.ts +207 -0
- package/src/stdio.ts +13 -0
- package/src/tools/index.ts +95 -0
- package/src/tools/logs/raw/bots-logs-raw.ts +196 -0
- package/src/tools/logs/raw/logs-logs-raw.ts +186 -0
- package/src/tools/organizations/categories/list-organizations-categories.ts +44 -0
- package/src/tools/organizations/categories/prompts-organizations-categories.ts +50 -0
- package/src/tools/organizations/categories/tags-organizations-categories.ts +50 -0
- package/src/tools/organizations/categories/topics-organizations-categories.ts +50 -0
- package/src/tools/organizations/domains-organizations.ts +44 -0
- package/src/tools/organizations/models-organizations.ts +44 -0
- package/src/tools/organizations/regions-organizations.ts +44 -0
- package/src/tools/prompts/answers-prompts.ts +200 -0
- package/src/tools/reports/citations-reports.ts +173 -0
- package/src/tools/reports/sentiment-reports.ts +173 -0
- package/src/tools/reports/visibility-reports.ts +173 -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/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 +79 -0
- package/tools/index.js.map +1 -0
- package/tools/index.mjs +72 -0
- package/tools/index.mjs.map +1 -0
- package/tools/logs/raw/bots-logs-raw.d.mts +45 -0
- package/tools/logs/raw/bots-logs-raw.d.mts.map +1 -0
- package/tools/logs/raw/bots-logs-raw.d.ts +45 -0
- package/tools/logs/raw/bots-logs-raw.d.ts.map +1 -0
- package/tools/logs/raw/bots-logs-raw.js +187 -0
- package/tools/logs/raw/bots-logs-raw.js.map +1 -0
- package/tools/logs/raw/bots-logs-raw.mjs +183 -0
- package/tools/logs/raw/bots-logs-raw.mjs.map +1 -0
- package/tools/logs/raw/logs-logs-raw.d.mts +45 -0
- package/tools/logs/raw/logs-logs-raw.d.mts.map +1 -0
- package/tools/logs/raw/logs-logs-raw.d.ts +45 -0
- package/tools/logs/raw/logs-logs-raw.d.ts.map +1 -0
- package/tools/logs/raw/logs-logs-raw.js +177 -0
- package/tools/logs/raw/logs-logs-raw.js.map +1 -0
- package/tools/logs/raw/logs-logs-raw.mjs +173 -0
- package/tools/logs/raw/logs-logs-raw.mjs.map +1 -0
- package/tools/organizations/categories/list-organizations-categories.d.mts +45 -0
- package/tools/organizations/categories/list-organizations-categories.d.mts.map +1 -0
- package/tools/organizations/categories/list-organizations-categories.d.ts +45 -0
- package/tools/organizations/categories/list-organizations-categories.d.ts.map +1 -0
- package/tools/organizations/categories/list-organizations-categories.js +39 -0
- package/tools/organizations/categories/list-organizations-categories.js.map +1 -0
- package/tools/organizations/categories/list-organizations-categories.mjs +35 -0
- package/tools/organizations/categories/list-organizations-categories.mjs.map +1 -0
- package/tools/organizations/categories/prompts-organizations-categories.d.mts +45 -0
- package/tools/organizations/categories/prompts-organizations-categories.d.mts.map +1 -0
- package/tools/organizations/categories/prompts-organizations-categories.d.ts +45 -0
- package/tools/organizations/categories/prompts-organizations-categories.d.ts.map +1 -0
- package/tools/organizations/categories/prompts-organizations-categories.js +43 -0
- package/tools/organizations/categories/prompts-organizations-categories.js.map +1 -0
- package/tools/organizations/categories/prompts-organizations-categories.mjs +39 -0
- package/tools/organizations/categories/prompts-organizations-categories.mjs.map +1 -0
- package/tools/organizations/categories/tags-organizations-categories.d.mts +45 -0
- package/tools/organizations/categories/tags-organizations-categories.d.mts.map +1 -0
- package/tools/organizations/categories/tags-organizations-categories.d.ts +45 -0
- package/tools/organizations/categories/tags-organizations-categories.d.ts.map +1 -0
- package/tools/organizations/categories/tags-organizations-categories.js +43 -0
- package/tools/organizations/categories/tags-organizations-categories.js.map +1 -0
- package/tools/organizations/categories/tags-organizations-categories.mjs +39 -0
- package/tools/organizations/categories/tags-organizations-categories.mjs.map +1 -0
- package/tools/organizations/categories/topics-organizations-categories.d.mts +45 -0
- package/tools/organizations/categories/topics-organizations-categories.d.mts.map +1 -0
- package/tools/organizations/categories/topics-organizations-categories.d.ts +45 -0
- package/tools/organizations/categories/topics-organizations-categories.d.ts.map +1 -0
- package/tools/organizations/categories/topics-organizations-categories.js +43 -0
- package/tools/organizations/categories/topics-organizations-categories.js.map +1 -0
- package/tools/organizations/categories/topics-organizations-categories.mjs +39 -0
- package/tools/organizations/categories/topics-organizations-categories.mjs.map +1 -0
- package/tools/organizations/domains-organizations.d.mts +45 -0
- package/tools/organizations/domains-organizations.d.mts.map +1 -0
- package/tools/organizations/domains-organizations.d.ts +45 -0
- package/tools/organizations/domains-organizations.d.ts.map +1 -0
- package/tools/organizations/domains-organizations.js +39 -0
- package/tools/organizations/domains-organizations.js.map +1 -0
- package/tools/organizations/domains-organizations.mjs +35 -0
- package/tools/organizations/domains-organizations.mjs.map +1 -0
- package/tools/organizations/models-organizations.d.mts +45 -0
- package/tools/organizations/models-organizations.d.mts.map +1 -0
- package/tools/organizations/models-organizations.d.ts +45 -0
- package/tools/organizations/models-organizations.d.ts.map +1 -0
- package/tools/organizations/models-organizations.js +39 -0
- package/tools/organizations/models-organizations.js.map +1 -0
- package/tools/organizations/models-organizations.mjs +35 -0
- package/tools/organizations/models-organizations.mjs.map +1 -0
- package/tools/organizations/regions-organizations.d.mts +45 -0
- package/tools/organizations/regions-organizations.d.mts.map +1 -0
- package/tools/organizations/regions-organizations.d.ts +45 -0
- package/tools/organizations/regions-organizations.d.ts.map +1 -0
- package/tools/organizations/regions-organizations.js +39 -0
- package/tools/organizations/regions-organizations.js.map +1 -0
- package/tools/organizations/regions-organizations.mjs +35 -0
- package/tools/organizations/regions-organizations.mjs.map +1 -0
- package/tools/prompts/answers-prompts.d.mts +45 -0
- package/tools/prompts/answers-prompts.d.mts.map +1 -0
- package/tools/prompts/answers-prompts.d.ts +45 -0
- package/tools/prompts/answers-prompts.d.ts.map +1 -0
- package/tools/prompts/answers-prompts.js +194 -0
- package/tools/prompts/answers-prompts.js.map +1 -0
- package/tools/prompts/answers-prompts.mjs +190 -0
- package/tools/prompts/answers-prompts.mjs.map +1 -0
- package/tools/reports/citations-reports.d.mts +45 -0
- package/tools/reports/citations-reports.d.mts.map +1 -0
- package/tools/reports/citations-reports.d.ts +45 -0
- package/tools/reports/citations-reports.d.ts.map +1 -0
- package/tools/reports/citations-reports.js +164 -0
- package/tools/reports/citations-reports.js.map +1 -0
- package/tools/reports/citations-reports.mjs +160 -0
- package/tools/reports/citations-reports.mjs.map +1 -0
- package/tools/reports/sentiment-reports.d.mts +45 -0
- package/tools/reports/sentiment-reports.d.mts.map +1 -0
- package/tools/reports/sentiment-reports.d.ts +45 -0
- package/tools/reports/sentiment-reports.d.ts.map +1 -0
- package/tools/reports/sentiment-reports.js +164 -0
- package/tools/reports/sentiment-reports.js.map +1 -0
- package/tools/reports/sentiment-reports.mjs +160 -0
- package/tools/reports/sentiment-reports.mjs.map +1 -0
- package/tools/reports/visibility-reports.d.mts +45 -0
- package/tools/reports/visibility-reports.d.mts.map +1 -0
- package/tools/reports/visibility-reports.d.ts +45 -0
- package/tools/reports/visibility-reports.d.ts.map +1 -0
- package/tools/reports/visibility-reports.js +164 -0
- package/tools/reports/visibility-reports.js.map +1 -0
- package/tools/reports/visibility-reports.mjs +160 -0
- package/tools/reports/visibility-reports.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
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { maybeFilter } from 'profound-mcp/filtering';
|
|
4
|
+
import { Metadata, asTextContentResult } from 'profound-mcp/tools/types';
|
|
5
|
+
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import Profound from 'profoundai';
|
|
8
|
+
|
|
9
|
+
export const metadata: Metadata = {
|
|
10
|
+
resource: 'reports',
|
|
11
|
+
operation: 'write',
|
|
12
|
+
tags: [],
|
|
13
|
+
httpMethod: 'post',
|
|
14
|
+
httpPath: '/v1/reports/visibility',
|
|
15
|
+
operationId: 'query_visibility_v1_reports_visibility_post',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const tool: Tool = {
|
|
19
|
+
name: 'visibility_reports',
|
|
20
|
+
description:
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nQuery visibility report.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/report_response',\n $defs: {\n report_response: {\n type: 'object',\n title: 'Response',\n description: 'Base response model for reports.',\n properties: {\n data: {\n type: 'array',\n title: 'Data',\n items: {\n $ref: '#/$defs/report_result'\n }\n },\n info: {\n $ref: '#/$defs/report_info'\n }\n },\n required: [ 'data',\n 'info'\n ]\n },\n report_result: {\n type: 'object',\n title: 'Result',\n description: 'Base model for report results.',\n properties: {\n dimensions: {\n type: 'array',\n title: 'Dimensions',\n items: {\n type: 'string'\n }\n },\n metrics: {\n type: 'array',\n title: 'Metrics',\n items: {\n type: 'number'\n }\n }\n },\n required: [ 'dimensions',\n 'metrics'\n ]\n },\n report_info: {\n type: 'object',\n title: 'Info',\n description: 'Base model for report information.',\n properties: {\n total_rows: {\n type: 'integer',\n title: 'Total Rows'\n },\n query: {\n type: 'object',\n title: 'Query',\n additionalProperties: true\n }\n },\n required: [ 'total_rows'\n ]\n }\n }\n}\n```",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
category_id: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
title: 'Category Id',
|
|
28
|
+
},
|
|
29
|
+
end_date: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
title: 'End Date',
|
|
32
|
+
description:
|
|
33
|
+
'End date for the report. Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or full ISO timestamp.',
|
|
34
|
+
format: 'date-time',
|
|
35
|
+
},
|
|
36
|
+
metrics: {
|
|
37
|
+
type: 'array',
|
|
38
|
+
title: 'Metrics',
|
|
39
|
+
items: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
enum: ['share_of_voice', 'mentions_count', 'visibility_score'],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
start_date: {
|
|
45
|
+
type: 'string',
|
|
46
|
+
title: 'Start Date',
|
|
47
|
+
description:
|
|
48
|
+
'Start date for the report. Accepts formats: YYYY-MM-DD, YYYY-MM-DD HH:MM, or full ISO timestamp.',
|
|
49
|
+
format: 'date-time',
|
|
50
|
+
},
|
|
51
|
+
date_interval: {
|
|
52
|
+
type: 'string',
|
|
53
|
+
title: 'Date Interval',
|
|
54
|
+
description: 'Date interval for the report. (only used with date dimension)',
|
|
55
|
+
enum: ['day', 'week', 'month', 'year'],
|
|
56
|
+
},
|
|
57
|
+
dimensions: {
|
|
58
|
+
type: 'array',
|
|
59
|
+
title: 'Dimensions',
|
|
60
|
+
description: 'Dimensions to group the report by.',
|
|
61
|
+
items: {
|
|
62
|
+
type: 'string',
|
|
63
|
+
enum: ['date', 'region', 'topic', 'model', 'asset_name', 'prompt', 'tag'],
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
filters: {
|
|
67
|
+
type: 'array',
|
|
68
|
+
title: 'Filters',
|
|
69
|
+
description: 'List of filters to apply to the report. Each filter has an operator, field, and value.',
|
|
70
|
+
items: {
|
|
71
|
+
type: 'object',
|
|
72
|
+
title: "Filter[Literal['region', 'topic', 'model', 'asset_name', 'prompt', 'tag']]",
|
|
73
|
+
properties: {
|
|
74
|
+
field: {
|
|
75
|
+
type: 'string',
|
|
76
|
+
title: 'Field',
|
|
77
|
+
enum: ['region', 'topic', 'model', 'asset_name', 'prompt', 'tag'],
|
|
78
|
+
},
|
|
79
|
+
operator: {
|
|
80
|
+
type: 'string',
|
|
81
|
+
title: 'Operator',
|
|
82
|
+
enum: [
|
|
83
|
+
'is',
|
|
84
|
+
'not_is',
|
|
85
|
+
'in',
|
|
86
|
+
'not_in',
|
|
87
|
+
'contains',
|
|
88
|
+
'not_contains',
|
|
89
|
+
'contains_case_insensitive',
|
|
90
|
+
'not_contains_case_insensitive',
|
|
91
|
+
'matches',
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
value: {
|
|
95
|
+
anyOf: [
|
|
96
|
+
{
|
|
97
|
+
type: 'string',
|
|
98
|
+
title: 'FilterStringValue',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
type: 'array',
|
|
102
|
+
title: 'FilterStringListValue',
|
|
103
|
+
items: {
|
|
104
|
+
type: 'string',
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
type: 'integer',
|
|
109
|
+
title: 'FilterIntegerValue',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
type: 'array',
|
|
113
|
+
title: 'FilterIntegerListValue',
|
|
114
|
+
items: {
|
|
115
|
+
type: 'integer',
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
title: 'Value',
|
|
120
|
+
description:
|
|
121
|
+
'Value for the filter. Can be a single value or a list of depending on the operator.',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
required: ['field', 'operator', 'value'],
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
order_by: {
|
|
128
|
+
type: 'object',
|
|
129
|
+
title: 'Order By',
|
|
130
|
+
description:
|
|
131
|
+
"\nCustom ordering of the report results.\n\nThe order is a record of key-value pairs where:\n- key is the field to order by, which can be a metric or dimension\n- value is the direction of the order, either 'asc' for ascending or 'desc' for descending.\n\nWhen not specified, the default order is the first metric in the query descending.\n ",
|
|
132
|
+
additionalProperties: true,
|
|
133
|
+
},
|
|
134
|
+
pagination: {
|
|
135
|
+
$ref: '#/$defs/pagination',
|
|
136
|
+
},
|
|
137
|
+
jq_filter: {
|
|
138
|
+
type: 'string',
|
|
139
|
+
title: 'jq Filter',
|
|
140
|
+
description:
|
|
141
|
+
'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
required: ['category_id', 'end_date', 'metrics', 'start_date'],
|
|
145
|
+
$defs: {
|
|
146
|
+
pagination: {
|
|
147
|
+
type: 'object',
|
|
148
|
+
title: 'Pagination',
|
|
149
|
+
description: 'Report pagination model.',
|
|
150
|
+
properties: {
|
|
151
|
+
limit: {
|
|
152
|
+
type: 'integer',
|
|
153
|
+
title: 'Limit',
|
|
154
|
+
description: 'Maximum number of results to return. Default is 10,000, maximum is 50,000.',
|
|
155
|
+
},
|
|
156
|
+
offset: {
|
|
157
|
+
type: 'integer',
|
|
158
|
+
title: 'Offset',
|
|
159
|
+
description: 'Offset for the results. Used for pagination.',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
annotations: {},
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export const handler = async (client: Profound, args: Record<string, unknown> | undefined) => {
|
|
169
|
+
const { jq_filter, ...body } = args as any;
|
|
170
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.reports.visibility(body)));
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
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 Profound from 'profoundai';
|
|
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: Profound,
|
|
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,10 @@
|
|
|
1
|
+
import { Metadata, Endpoint, HandlerFunction } from "./types.mjs";
|
|
2
|
+
export { Metadata, Endpoint, HandlerFunction };
|
|
3
|
+
export declare const endpoints: Endpoint[];
|
|
4
|
+
export type Filter = {
|
|
5
|
+
type: 'resource' | 'operation' | 'tag' | 'tool';
|
|
6
|
+
op: 'include' | 'exclude';
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function query(filters: Filter[], endpoints: Endpoint[]): Endpoint[];
|
|
10
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/tools/index.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE;AAE9C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;AAgB/C,eAAO,MAAM,SAAS,EAAE,QAAQ,EAAO,CAAC;AAoBxC,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,UAAU,GAAG,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC;IAChD,EAAE,EAAE,SAAS,GAAG,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,CA4B1E"}
|
package/tools/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Metadata, Endpoint, HandlerFunction } from "./types.js";
|
|
2
|
+
export { Metadata, Endpoint, HandlerFunction };
|
|
3
|
+
export declare const endpoints: Endpoint[];
|
|
4
|
+
export type Filter = {
|
|
5
|
+
type: 'resource' | 'operation' | 'tag' | 'tool';
|
|
6
|
+
op: 'include' | 'exclude';
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function query(filters: Filter[], endpoints: Endpoint[]): Endpoint[];
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/tools/index.ts"],"names":[],"mappings":"OAEO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE;AAE9C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;AAgB/C,eAAO,MAAM,SAAS,EAAE,QAAQ,EAAO,CAAC;AAoBxC,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,UAAU,GAAG,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC;IAChD,EAAE,EAAE,SAAS,GAAG,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,CA4B1E"}
|
package/tools/index.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.endpoints = void 0;
|
|
8
|
+
exports.query = query;
|
|
9
|
+
const domains_organizations_1 = __importDefault(require("./organizations/domains-organizations.js"));
|
|
10
|
+
const models_organizations_1 = __importDefault(require("./organizations/models-organizations.js"));
|
|
11
|
+
const regions_organizations_1 = __importDefault(require("./organizations/regions-organizations.js"));
|
|
12
|
+
const list_organizations_categories_1 = __importDefault(require("./organizations/categories/list-organizations-categories.js"));
|
|
13
|
+
const prompts_organizations_categories_1 = __importDefault(require("./organizations/categories/prompts-organizations-categories.js"));
|
|
14
|
+
const tags_organizations_categories_1 = __importDefault(require("./organizations/categories/tags-organizations-categories.js"));
|
|
15
|
+
const topics_organizations_categories_1 = __importDefault(require("./organizations/categories/topics-organizations-categories.js"));
|
|
16
|
+
const answers_prompts_1 = __importDefault(require("./prompts/answers-prompts.js"));
|
|
17
|
+
const citations_reports_1 = __importDefault(require("./reports/citations-reports.js"));
|
|
18
|
+
const sentiment_reports_1 = __importDefault(require("./reports/sentiment-reports.js"));
|
|
19
|
+
const visibility_reports_1 = __importDefault(require("./reports/visibility-reports.js"));
|
|
20
|
+
const bots_logs_raw_1 = __importDefault(require("./logs/raw/bots-logs-raw.js"));
|
|
21
|
+
const logs_logs_raw_1 = __importDefault(require("./logs/raw/logs-logs-raw.js"));
|
|
22
|
+
exports.endpoints = [];
|
|
23
|
+
function addEndpoint(endpoint) {
|
|
24
|
+
exports.endpoints.push(endpoint);
|
|
25
|
+
}
|
|
26
|
+
addEndpoint(domains_organizations_1.default);
|
|
27
|
+
addEndpoint(models_organizations_1.default);
|
|
28
|
+
addEndpoint(regions_organizations_1.default);
|
|
29
|
+
addEndpoint(list_organizations_categories_1.default);
|
|
30
|
+
addEndpoint(prompts_organizations_categories_1.default);
|
|
31
|
+
addEndpoint(tags_organizations_categories_1.default);
|
|
32
|
+
addEndpoint(topics_organizations_categories_1.default);
|
|
33
|
+
addEndpoint(answers_prompts_1.default);
|
|
34
|
+
addEndpoint(citations_reports_1.default);
|
|
35
|
+
addEndpoint(sentiment_reports_1.default);
|
|
36
|
+
addEndpoint(visibility_reports_1.default);
|
|
37
|
+
addEndpoint(bots_logs_raw_1.default);
|
|
38
|
+
addEndpoint(logs_logs_raw_1.default);
|
|
39
|
+
function query(filters, endpoints) {
|
|
40
|
+
const allExcludes = filters.length > 0 && filters.every((filter) => filter.op === 'exclude');
|
|
41
|
+
const unmatchedFilters = new Set(filters);
|
|
42
|
+
const filtered = endpoints.filter((endpoint) => {
|
|
43
|
+
let included = false || allExcludes;
|
|
44
|
+
for (const filter of filters) {
|
|
45
|
+
if (match(filter, endpoint)) {
|
|
46
|
+
unmatchedFilters.delete(filter);
|
|
47
|
+
included = filter.op === 'include';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return included;
|
|
51
|
+
});
|
|
52
|
+
// Check if any filters didn't match
|
|
53
|
+
const unmatched = Array.from(unmatchedFilters).filter((f) => f.type === 'tool' || f.type === 'resource');
|
|
54
|
+
if (unmatched.length > 0) {
|
|
55
|
+
throw new Error(`The following filters did not match any endpoints: ${unmatched
|
|
56
|
+
.map((f) => `${f.type}=${f.value}`)
|
|
57
|
+
.join(', ')}`);
|
|
58
|
+
}
|
|
59
|
+
return filtered;
|
|
60
|
+
}
|
|
61
|
+
function match({ type, value }, endpoint) {
|
|
62
|
+
switch (type) {
|
|
63
|
+
case 'resource': {
|
|
64
|
+
const regexStr = '^' + normalizeResource(value).replace(/\*/g, '.*') + '$';
|
|
65
|
+
const regex = new RegExp(regexStr);
|
|
66
|
+
return regex.test(normalizeResource(endpoint.metadata.resource));
|
|
67
|
+
}
|
|
68
|
+
case 'operation':
|
|
69
|
+
return endpoint.metadata.operation === value;
|
|
70
|
+
case 'tag':
|
|
71
|
+
return endpoint.metadata.tags.includes(value);
|
|
72
|
+
case 'tool':
|
|
73
|
+
return endpoint.tool.name === value;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function normalizeResource(resource) {
|
|
77
|
+
return resource.toLowerCase().replace(/[^a-z.*\-_]*/g, '');
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/tools/index.ts"],"names":[],"mappings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,CAAC,CAAC,CAAC;QACnE,CAAC;QACD,KAAK,WAAW;YACd,OAAO,QAAQ,CAAC,QAAQ,CAAC,SAAS,KAAK,KAAK,CAAC;QAC/C,KAAK,KAAK;YACR,OAAO,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAChD,KAAK,MAAM;YACT,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC;IACxC,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAgB;IACzC,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;AAC7D,CAAC"}
|
package/tools/index.mjs
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import domains_organizations from "./organizations/domains-organizations.mjs";
|
|
3
|
+
import models_organizations from "./organizations/models-organizations.mjs";
|
|
4
|
+
import regions_organizations from "./organizations/regions-organizations.mjs";
|
|
5
|
+
import list_organizations_categories from "./organizations/categories/list-organizations-categories.mjs";
|
|
6
|
+
import prompts_organizations_categories from "./organizations/categories/prompts-organizations-categories.mjs";
|
|
7
|
+
import tags_organizations_categories from "./organizations/categories/tags-organizations-categories.mjs";
|
|
8
|
+
import topics_organizations_categories from "./organizations/categories/topics-organizations-categories.mjs";
|
|
9
|
+
import answers_prompts from "./prompts/answers-prompts.mjs";
|
|
10
|
+
import citations_reports from "./reports/citations-reports.mjs";
|
|
11
|
+
import sentiment_reports from "./reports/sentiment-reports.mjs";
|
|
12
|
+
import visibility_reports from "./reports/visibility-reports.mjs";
|
|
13
|
+
import bots_logs_raw from "./logs/raw/bots-logs-raw.mjs";
|
|
14
|
+
import logs_logs_raw from "./logs/raw/logs-logs-raw.mjs";
|
|
15
|
+
export const endpoints = [];
|
|
16
|
+
function addEndpoint(endpoint) {
|
|
17
|
+
endpoints.push(endpoint);
|
|
18
|
+
}
|
|
19
|
+
addEndpoint(domains_organizations);
|
|
20
|
+
addEndpoint(models_organizations);
|
|
21
|
+
addEndpoint(regions_organizations);
|
|
22
|
+
addEndpoint(list_organizations_categories);
|
|
23
|
+
addEndpoint(prompts_organizations_categories);
|
|
24
|
+
addEndpoint(tags_organizations_categories);
|
|
25
|
+
addEndpoint(topics_organizations_categories);
|
|
26
|
+
addEndpoint(answers_prompts);
|
|
27
|
+
addEndpoint(citations_reports);
|
|
28
|
+
addEndpoint(sentiment_reports);
|
|
29
|
+
addEndpoint(visibility_reports);
|
|
30
|
+
addEndpoint(bots_logs_raw);
|
|
31
|
+
addEndpoint(logs_logs_raw);
|
|
32
|
+
export function query(filters, endpoints) {
|
|
33
|
+
const allExcludes = filters.length > 0 && filters.every((filter) => filter.op === 'exclude');
|
|
34
|
+
const unmatchedFilters = new Set(filters);
|
|
35
|
+
const filtered = endpoints.filter((endpoint) => {
|
|
36
|
+
let included = false || allExcludes;
|
|
37
|
+
for (const filter of filters) {
|
|
38
|
+
if (match(filter, endpoint)) {
|
|
39
|
+
unmatchedFilters.delete(filter);
|
|
40
|
+
included = filter.op === 'include';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return included;
|
|
44
|
+
});
|
|
45
|
+
// Check if any filters didn't match
|
|
46
|
+
const unmatched = Array.from(unmatchedFilters).filter((f) => f.type === 'tool' || f.type === 'resource');
|
|
47
|
+
if (unmatched.length > 0) {
|
|
48
|
+
throw new Error(`The following filters did not match any endpoints: ${unmatched
|
|
49
|
+
.map((f) => `${f.type}=${f.value}`)
|
|
50
|
+
.join(', ')}`);
|
|
51
|
+
}
|
|
52
|
+
return filtered;
|
|
53
|
+
}
|
|
54
|
+
function match({ type, value }, endpoint) {
|
|
55
|
+
switch (type) {
|
|
56
|
+
case 'resource': {
|
|
57
|
+
const regexStr = '^' + normalizeResource(value).replace(/\*/g, '.*') + '$';
|
|
58
|
+
const regex = new RegExp(regexStr);
|
|
59
|
+
return regex.test(normalizeResource(endpoint.metadata.resource));
|
|
60
|
+
}
|
|
61
|
+
case 'operation':
|
|
62
|
+
return endpoint.metadata.operation === value;
|
|
63
|
+
case 'tag':
|
|
64
|
+
return endpoint.metadata.tags.includes(value);
|
|
65
|
+
case 'tool':
|
|
66
|
+
return endpoint.tool.name === value;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function normalizeResource(resource) {
|
|
70
|
+
return resource.toLowerCase().replace(/[^a-z.*\-_]*/g, '');
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/tools/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAM/E,qBAAqB;OACrB,oBAAoB;OACpB,qBAAqB;OACrB,6BAA6B;OAC7B,gCAAgC;OAChC,6BAA6B;OAC7B,+BAA+B;OAC/B,eAAe;OACf,iBAAiB;OACjB,iBAAiB;OACjB,kBAAkB;OAClB,aAAa;OACb,aAAa;AAEpB,MAAM,CAAC,MAAM,SAAS,GAAe,EAAE,CAAC;AAExC,SAAS,WAAW,CAAC,QAAkB;IACrC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC3B,CAAC;AAED,WAAW,CAAC,qBAAqB,CAAC,CAAC;AACnC,WAAW,CAAC,oBAAoB,CAAC,CAAC;AAClC,WAAW,CAAC,qBAAqB,CAAC,CAAC;AACnC,WAAW,CAAC,6BAA6B,CAAC,CAAC;AAC3C,WAAW,CAAC,gCAAgC,CAAC,CAAC;AAC9C,WAAW,CAAC,6BAA6B,CAAC,CAAC;AAC3C,WAAW,CAAC,+BAA+B,CAAC,CAAC;AAC7C,WAAW,CAAC,eAAe,CAAC,CAAC;AAC7B,WAAW,CAAC,iBAAiB,CAAC,CAAC;AAC/B,WAAW,CAAC,iBAAiB,CAAC,CAAC;AAC/B,WAAW,CAAC,kBAAkB,CAAC,CA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,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,KAAK,CAAC,EAAE,IAAI,EAAE,KAAK,EAAU,EAAE,QAAkB;IACxD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,UAAU,CAAC,CAAC,CAAC;YAChB,MAAM,QAAQ,GAAG,GAAG,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC;YAC3E,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;YACnC,OAAO,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;QACnE,CAAC;QACD,KAAK,WAAW;YACd,OAAO,QAAQ,CAAC,QAAQ,CAAC,SAAS,KAAK,KAAK,CAAC;QAC/C,KAAK,KAAK;YACR,OAAO,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAChD,KAAK,MAAM;YACT,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC;IACxC,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAgB;IACzC,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Metadata } from 'profound-mcp/tools/types';
|
|
2
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import Profound from 'profoundai';
|
|
4
|
+
export declare const metadata: Metadata;
|
|
5
|
+
export declare const tool: Tool;
|
|
6
|
+
export declare const handler: (client: Profound, args: Record<string, unknown> | undefined) => Promise<import("profound-mcp/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: Profound, args: Record<string, unknown> | undefined) => Promise<import("profound-mcp/tools/types").ToolCallResult>;
|
|
43
|
+
};
|
|
44
|
+
export default _default;
|
|
45
|
+
//# sourceMappingURL=bots-logs-raw.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bots-logs-raw.d.mts","sourceRoot":"","sources":["../../../src/tools/logs/raw/bots-logs-raw.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAuB,MAAM,0BAA0B;OAEjE,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,YAAY;AAEjC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IA2KlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,+DAGxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAKzF,wBAA2C"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Metadata } from 'profound-mcp/tools/types';
|
|
2
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import Profound from 'profoundai';
|
|
4
|
+
export declare const metadata: Metadata;
|
|
5
|
+
export declare const tool: Tool;
|
|
6
|
+
export declare const handler: (client: Profound, args: Record<string, unknown> | undefined) => Promise<import("profound-mcp/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: Profound, args: Record<string, unknown> | undefined) => Promise<import("profound-mcp/tools/types").ToolCallResult>;
|
|
43
|
+
};
|
|
44
|
+
export default _default;
|
|
45
|
+
//# sourceMappingURL=bots-logs-raw.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bots-logs-raw.d.ts","sourceRoot":"","sources":["../../../src/tools/logs/raw/bots-logs-raw.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAuB,MAAM,0BAA0B;OAEjE,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,YAAY;AAEjC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IA2KlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,+DAGxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAKzF,wBAA2C"}
|