@lightsage/mcp 0.4.16 → 0.4.17
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/README.md +2 -2
- package/api/mcp.js +30 -0
- package/bin/mcp-server.js +1757 -508
- package/bin/mcp-server.js.map +55 -24
- package/esm/funcs/agentAnalyticsCountriesList.d.ts +16 -0
- package/esm/funcs/agentAnalyticsCountriesList.d.ts.map +1 -0
- package/esm/funcs/agentAnalyticsCountriesList.js +94 -0
- package/esm/funcs/agentAnalyticsCountriesList.js.map +1 -0
- package/esm/funcs/agentAnalyticsErrorPagesList.d.ts +16 -0
- package/esm/funcs/agentAnalyticsErrorPagesList.d.ts.map +1 -0
- package/esm/funcs/agentAnalyticsErrorPagesList.js +96 -0
- package/esm/funcs/agentAnalyticsErrorPagesList.js.map +1 -0
- package/esm/funcs/agentAnalyticsPagesList.d.ts +16 -0
- package/esm/funcs/agentAnalyticsPagesList.d.ts.map +1 -0
- package/esm/funcs/agentAnalyticsPagesList.js +98 -0
- package/esm/funcs/agentAnalyticsPagesList.js.map +1 -0
- package/esm/funcs/agentAnalyticsSitesList.d.ts +15 -0
- package/esm/funcs/agentAnalyticsSitesList.d.ts.map +1 -0
- package/esm/funcs/agentAnalyticsSitesList.js +72 -0
- package/esm/funcs/agentAnalyticsSitesList.js.map +1 -0
- package/esm/funcs/agentAnalyticsSourcesList.d.ts +16 -0
- package/esm/funcs/agentAnalyticsSourcesList.d.ts.map +1 -0
- package/esm/funcs/agentAnalyticsSourcesList.js +93 -0
- package/esm/funcs/agentAnalyticsSourcesList.js.map +1 -0
- package/esm/funcs/agentAnalyticsSummaryRetrieve.d.ts +16 -0
- package/esm/funcs/agentAnalyticsSummaryRetrieve.d.ts.map +1 -0
- package/esm/funcs/agentAnalyticsSummaryRetrieve.js +93 -0
- package/esm/funcs/agentAnalyticsSummaryRetrieve.js.map +1 -0
- package/esm/funcs/tasksCreate.d.ts +16 -0
- package/esm/funcs/tasksCreate.d.ts.map +1 -0
- package/esm/funcs/tasksCreate.js +83 -0
- package/esm/funcs/tasksCreate.js.map +1 -0
- package/esm/landing-page.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/mcp-server/mcp-server.js +1 -1
- package/esm/mcp-server/server.d.ts.map +1 -1
- package/esm/mcp-server/server.js +15 -1
- package/esm/mcp-server/server.js.map +1 -1
- package/esm/mcp-server/tools/agentAnalyticsCountriesList.d.ts +7 -0
- package/esm/mcp-server/tools/agentAnalyticsCountriesList.d.ts.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsCountriesList.js +35 -0
- package/esm/mcp-server/tools/agentAnalyticsCountriesList.js.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsErrorPagesList.d.ts +7 -0
- package/esm/mcp-server/tools/agentAnalyticsErrorPagesList.d.ts.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsErrorPagesList.js +35 -0
- package/esm/mcp-server/tools/agentAnalyticsErrorPagesList.js.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsPagesList.d.ts +7 -0
- package/esm/mcp-server/tools/agentAnalyticsPagesList.d.ts.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsPagesList.js +35 -0
- package/esm/mcp-server/tools/agentAnalyticsPagesList.js.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsSitesList.d.ts +3 -0
- package/esm/mcp-server/tools/agentAnalyticsSitesList.d.ts.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsSitesList.js +30 -0
- package/esm/mcp-server/tools/agentAnalyticsSitesList.js.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsSourcesList.d.ts +7 -0
- package/esm/mcp-server/tools/agentAnalyticsSourcesList.d.ts.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsSourcesList.js +35 -0
- package/esm/mcp-server/tools/agentAnalyticsSourcesList.js.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsSummaryRetrieve.d.ts +7 -0
- package/esm/mcp-server/tools/agentAnalyticsSummaryRetrieve.d.ts.map +1 -0
- package/esm/mcp-server/tools/agentAnalyticsSummaryRetrieve.js +35 -0
- package/esm/mcp-server/tools/agentAnalyticsSummaryRetrieve.js.map +1 -0
- package/esm/mcp-server/tools/tasksCreate.d.ts +7 -0
- package/esm/mcp-server/tools/tasksCreate.d.ts.map +1 -0
- package/esm/mcp-server/tools/tasksCreate.js +35 -0
- package/esm/mcp-server/tools/tasksCreate.js.map +1 -0
- package/esm/models/createtaskrequest.d.ts +65 -0
- package/esm/models/createtaskrequest.d.ts.map +1 -0
- package/esm/models/createtaskrequest.js +64 -0
- package/esm/models/createtaskrequest.js.map +1 -0
- package/esm/models/graderdefinition.d.ts +1 -0
- package/esm/models/graderdefinition.d.ts.map +1 -1
- package/esm/models/graderdefinition.js +1 -0
- package/esm/models/graderdefinition.js.map +1 -1
- package/esm/models/publicagentanalyticscountrylistresponse.d.ts +10 -0
- package/esm/models/publicagentanalyticscountrylistresponse.d.ts.map +1 -0
- package/esm/models/publicagentanalyticscountrylistresponse.js +13 -0
- package/esm/models/publicagentanalyticscountrylistresponse.js.map +1 -0
- package/esm/models/publicagentanalyticserrorpagelistresponse.d.ts +11 -0
- package/esm/models/publicagentanalyticserrorpagelistresponse.d.ts.map +1 -0
- package/esm/models/publicagentanalyticserrorpagelistresponse.js +14 -0
- package/esm/models/publicagentanalyticserrorpagelistresponse.js.map +1 -0
- package/esm/models/publicagentanalyticspagelistresponse.d.ts +11 -0
- package/esm/models/publicagentanalyticspagelistresponse.d.ts.map +1 -0
- package/esm/models/publicagentanalyticspagelistresponse.js +14 -0
- package/esm/models/publicagentanalyticspagelistresponse.js.map +1 -0
- package/esm/models/publicagentanalyticssite.d.ts +9 -0
- package/esm/models/publicagentanalyticssite.d.ts.map +1 -0
- package/esm/models/publicagentanalyticssite.js +12 -0
- package/esm/models/publicagentanalyticssite.js.map +1 -0
- package/esm/models/publicagentanalyticssitelistresponse.d.ts +7 -0
- package/esm/models/publicagentanalyticssitelistresponse.d.ts.map +1 -0
- package/esm/models/publicagentanalyticssitelistresponse.js +10 -0
- package/esm/models/publicagentanalyticssitelistresponse.js.map +1 -0
- package/esm/models/publicagentanalyticssourcelistresponse.d.ts +10 -0
- package/esm/models/publicagentanalyticssourcelistresponse.d.ts.map +1 -0
- package/esm/models/publicagentanalyticssourcelistresponse.js +13 -0
- package/esm/models/publicagentanalyticssourcelistresponse.js.map +1 -0
- package/esm/models/publicagentanalyticssummary.d.ts +11 -0
- package/esm/models/publicagentanalyticssummary.d.ts.map +1 -0
- package/esm/models/publicagentanalyticssummary.js +14 -0
- package/esm/models/publicagentanalyticssummary.js.map +1 -0
- package/esm/models/publicagentcountry.d.ts +7 -0
- package/esm/models/publicagentcountry.d.ts.map +1 -0
- package/esm/models/publicagentcountry.js +11 -0
- package/esm/models/publicagentcountry.js.map +1 -0
- package/esm/models/publicagenterrorpage.d.ts +12 -0
- package/esm/models/publicagenterrorpage.d.ts.map +1 -0
- package/esm/models/publicagenterrorpage.js +16 -0
- package/esm/models/publicagenterrorpage.js.map +1 -0
- package/esm/models/publicagenterrorsource.d.ts +40 -0
- package/esm/models/publicagenterrorsource.d.ts.map +1 -0
- package/esm/models/publicagenterrorsource.js +40 -0
- package/esm/models/publicagenterrorsource.js.map +1 -0
- package/esm/models/publicagenttrafficpage.d.ts +14 -0
- package/esm/models/publicagenttrafficpage.d.ts.map +1 -0
- package/esm/models/publicagenttrafficpage.js +17 -0
- package/esm/models/publicagenttrafficpage.js.map +1 -0
- package/esm/models/publicagenttrafficsource.d.ts +47 -0
- package/esm/models/publicagenttrafficsource.d.ts.map +1 -0
- package/esm/models/publicagenttrafficsource.js +44 -0
- package/esm/models/publicagenttrafficsource.js.map +1 -0
- package/esm/models/publicagenttraffictotals.d.ts +13 -0
- package/esm/models/publicagenttraffictotals.d.ts.map +1 -0
- package/esm/models/publicagenttraffictotals.js +16 -0
- package/esm/models/publicagenttraffictotals.js.map +1 -0
- package/esm/models/updatetaskrequest.d.ts +8 -8
- package/esm/models/updatetaskrequest.d.ts.map +1 -1
- package/esm/models/updatetaskrequest.js +6 -6
- package/esm/models/updatetaskrequest.js.map +1 -1
- package/esm/models/v2agentanalyticscountrieslistop.d.ts +13 -0
- package/esm/models/v2agentanalyticscountrieslistop.d.ts.map +1 -0
- package/esm/models/v2agentanalyticscountrieslistop.js +18 -0
- package/esm/models/v2agentanalyticscountrieslistop.js.map +1 -0
- package/esm/models/v2agentanalyticserrorpageslistop.d.ts +39 -0
- package/esm/models/v2agentanalyticserrorpageslistop.d.ts.map +1 -0
- package/esm/models/v2agentanalyticserrorpageslistop.js +39 -0
- package/esm/models/v2agentanalyticserrorpageslistop.js.map +1 -0
- package/esm/models/v2agentanalyticspageslistop.d.ts +68 -0
- package/esm/models/v2agentanalyticspageslistop.d.ts.map +1 -0
- package/esm/models/v2agentanalyticspageslistop.js +65 -0
- package/esm/models/v2agentanalyticspageslistop.js.map +1 -0
- package/esm/models/v2agentanalyticssourceslistop.d.ts +12 -0
- package/esm/models/v2agentanalyticssourceslistop.d.ts.map +1 -0
- package/esm/models/v2agentanalyticssourceslistop.js +17 -0
- package/esm/models/v2agentanalyticssourceslistop.js.map +1 -0
- package/esm/models/v2agentanalyticssummaryretrieveop.d.ts +12 -0
- package/esm/models/v2agentanalyticssummaryretrieveop.d.ts.map +1 -0
- package/esm/models/v2agentanalyticssummaryretrieveop.js +17 -0
- package/esm/models/v2agentanalyticssummaryretrieveop.js.map +1 -0
- package/esm/models/v2inlinemcpdefinition.js +1 -1
- package/esm/models/v2inlinemcpdefinition.js.map +1 -1
- package/esm/models/v2repository.d.ts +4 -4
- package/esm/models/v2repository.d.ts.map +1 -1
- package/esm/models/v2repository.js +3 -3
- package/esm/models/v2repository.js.map +1 -1
- package/esm/models/v2taskscreateop.d.ts +13 -0
- package/esm/models/v2taskscreateop.d.ts.map +1 -0
- package/esm/models/v2taskscreateop.js +16 -0
- package/esm/models/v2taskscreateop.js.map +1 -0
- package/esm/tool-names.d.ts.map +1 -1
- package/esm/tool-names.js +28 -0
- package/esm/tool-names.js.map +1 -1
- package/lib/tracker.js +219 -0
- package/package.json +3 -1
- package/src/funcs/agentAnalyticsCountriesList.ts +159 -0
- package/src/funcs/agentAnalyticsErrorPagesList.ts +161 -0
- package/src/funcs/agentAnalyticsPagesList.ts +163 -0
- package/src/funcs/agentAnalyticsSitesList.ts +124 -0
- package/src/funcs/agentAnalyticsSourcesList.ts +158 -0
- package/src/funcs/agentAnalyticsSummaryRetrieve.ts +158 -0
- package/src/funcs/tasksCreate.ts +145 -0
- package/src/landing-page.ts +1 -1
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +15 -1
- package/src/mcp-server/tools/agentAnalyticsCountriesList.ts +43 -0
- package/src/mcp-server/tools/agentAnalyticsErrorPagesList.ts +43 -0
- package/src/mcp-server/tools/agentAnalyticsPagesList.ts +43 -0
- package/src/mcp-server/tools/agentAnalyticsSitesList.ts +36 -0
- package/src/mcp-server/tools/agentAnalyticsSourcesList.ts +43 -0
- package/src/mcp-server/tools/agentAnalyticsSummaryRetrieve.ts +43 -0
- package/src/mcp-server/tools/tasksCreate.ts +43 -0
- package/src/models/createtaskrequest.ts +98 -0
- package/src/models/graderdefinition.ts +2 -0
- package/src/models/publicagentanalyticscountrylistresponse.ts +28 -0
- package/src/models/publicagentanalyticserrorpagelistresponse.ts +32 -0
- package/src/models/publicagentanalyticspagelistresponse.ts +30 -0
- package/src/models/publicagentanalyticssite.ts +26 -0
- package/src/models/publicagentanalyticssitelistresponse.ts +20 -0
- package/src/models/publicagentanalyticssourcelistresponse.ts +28 -0
- package/src/models/publicagentanalyticssummary.ts +28 -0
- package/src/models/publicagentcountry.ts +16 -0
- package/src/models/publicagenterrorpage.ts +35 -0
- package/src/models/publicagenterrorsource.ts +63 -0
- package/src/models/publicagenttrafficpage.ts +46 -0
- package/src/models/publicagenttrafficsource.ts +77 -0
- package/src/models/publicagenttraffictotals.ts +42 -0
- package/src/models/updatetaskrequest.ts +14 -10
- package/src/models/v2agentanalyticscountrieslistop.ts +45 -0
- package/src/models/v2agentanalyticserrorpageslistop.ts +79 -0
- package/src/models/v2agentanalyticspageslistop.ts +119 -0
- package/src/models/v2agentanalyticssourceslistop.ts +43 -0
- package/src/models/v2agentanalyticssummaryretrieveop.ts +43 -0
- package/src/models/v2inlinemcpdefinition.ts +1 -1
- package/src/models/v2repository.ts +5 -5
- package/src/models/v2taskscreateop.ts +34 -0
- package/src/tool-names.ts +28 -0
- package/test/tracker.test.js +323 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 9a8454f939b0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { LightsageMcpCore } from "../core.js";
|
|
7
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import {
|
|
23
|
+
V2AgentAnalyticsSourcesListRequest,
|
|
24
|
+
V2AgentAnalyticsSourcesListRequest$zodSchema,
|
|
25
|
+
} from "../models/v2agentanalyticssourceslistop.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* List Agent Analytics Sources
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Returns every coding agent and bot that visited a site in the date range, with its traffic type and visit count, most visits first. Human visits are one `people` row.
|
|
34
|
+
*/
|
|
35
|
+
export function agentAnalyticsSourcesList(
|
|
36
|
+
client$: LightsageMcpCore,
|
|
37
|
+
request: V2AgentAnalyticsSourcesListRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
Response,
|
|
42
|
+
| APIError
|
|
43
|
+
| SDKValidationError
|
|
44
|
+
| UnexpectedClientError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| ConnectionError
|
|
49
|
+
>
|
|
50
|
+
> {
|
|
51
|
+
return new APIPromise($do(
|
|
52
|
+
client$,
|
|
53
|
+
request,
|
|
54
|
+
options,
|
|
55
|
+
));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function $do(
|
|
59
|
+
client$: LightsageMcpCore,
|
|
60
|
+
request: V2AgentAnalyticsSourcesListRequest,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
Response,
|
|
66
|
+
| APIError
|
|
67
|
+
| SDKValidationError
|
|
68
|
+
| UnexpectedClientError
|
|
69
|
+
| InvalidRequestError
|
|
70
|
+
| RequestAbortedError
|
|
71
|
+
| RequestTimeoutError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed$ = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value$) => V2AgentAnalyticsSourcesListRequest$zodSchema.parse(value$),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed$.ok) {
|
|
83
|
+
return [parsed$, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload$ = parsed$.value;
|
|
86
|
+
const body$ = null;
|
|
87
|
+
|
|
88
|
+
const pathParams$ = {
|
|
89
|
+
site_id: encodeSimple("site_id", payload$.site_id, {
|
|
90
|
+
explode: false,
|
|
91
|
+
charEncoding: "percent",
|
|
92
|
+
}),
|
|
93
|
+
};
|
|
94
|
+
const path$ = pathToFunc("/v2/agent-analytics/sites/{site_id}/sources")(
|
|
95
|
+
pathParams$,
|
|
96
|
+
);
|
|
97
|
+
const query$ = encodeFormQuery({
|
|
98
|
+
"end_date": payload$.end_date,
|
|
99
|
+
"start_date": payload$.start_date,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const headers$ = new Headers(compactMap({
|
|
103
|
+
Accept: "application/json",
|
|
104
|
+
}));
|
|
105
|
+
const securityInput = await extractSecurity(client$._options.security);
|
|
106
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
107
|
+
|
|
108
|
+
const context = {
|
|
109
|
+
options: client$._options,
|
|
110
|
+
baseURL: options?.serverURL ?? client$._baseURL ?? "",
|
|
111
|
+
operationID: "v2_agent_analytics_sources_list",
|
|
112
|
+
oAuth2Scopes: null,
|
|
113
|
+
resolvedSecurity: requestSecurity,
|
|
114
|
+
securitySource: client$._options.security,
|
|
115
|
+
retryConfig: options?.retries
|
|
116
|
+
|| client$._options.retryConfig
|
|
117
|
+
|| { strategy: "none" },
|
|
118
|
+
retryCodes: options?.retryCodes || [
|
|
119
|
+
"429",
|
|
120
|
+
"500",
|
|
121
|
+
"502",
|
|
122
|
+
"503",
|
|
123
|
+
"504",
|
|
124
|
+
],
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const requestRes = client$._createRequest(context, {
|
|
128
|
+
security: requestSecurity,
|
|
129
|
+
method: "GET",
|
|
130
|
+
baseURL: options?.serverURL,
|
|
131
|
+
path: path$,
|
|
132
|
+
headers: headers$,
|
|
133
|
+
query: query$,
|
|
134
|
+
body: body$,
|
|
135
|
+
userAgent: client$._options.userAgent,
|
|
136
|
+
timeoutMs: options?.timeoutMs || client$._options.timeoutMs
|
|
137
|
+
|| -1,
|
|
138
|
+
}, options);
|
|
139
|
+
if (!requestRes.ok) {
|
|
140
|
+
return [requestRes, { status: "invalid" }];
|
|
141
|
+
}
|
|
142
|
+
const req$ = requestRes.value;
|
|
143
|
+
|
|
144
|
+
const doResult = await client$._do(req$, {
|
|
145
|
+
context,
|
|
146
|
+
errorCodes: [],
|
|
147
|
+
retryConfig: context.retryConfig,
|
|
148
|
+
retryCodes: context.retryCodes,
|
|
149
|
+
});
|
|
150
|
+
if (!doResult.ok) {
|
|
151
|
+
return [doResult, { status: "request-error", request: req$ }];
|
|
152
|
+
}
|
|
153
|
+
return [doResult, {
|
|
154
|
+
status: "complete",
|
|
155
|
+
"request": req$,
|
|
156
|
+
response: doResult.value,
|
|
157
|
+
}];
|
|
158
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 61717c0f36b3
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { LightsageMcpCore } from "../core.js";
|
|
7
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import {
|
|
23
|
+
V2AgentAnalyticsSummaryRetrieveRequest,
|
|
24
|
+
V2AgentAnalyticsSummaryRetrieveRequest$zodSchema,
|
|
25
|
+
} from "../models/v2agentanalyticssummaryretrieveop.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Retrieve Agent Analytics Summary
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Returns a site's visits by traffic type (coding agents, user-requested AI fetches, AI search, AI training, other bots, and people) for the date range and for the same number of days before it.
|
|
34
|
+
*/
|
|
35
|
+
export function agentAnalyticsSummaryRetrieve(
|
|
36
|
+
client$: LightsageMcpCore,
|
|
37
|
+
request: V2AgentAnalyticsSummaryRetrieveRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
Response,
|
|
42
|
+
| APIError
|
|
43
|
+
| SDKValidationError
|
|
44
|
+
| UnexpectedClientError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| ConnectionError
|
|
49
|
+
>
|
|
50
|
+
> {
|
|
51
|
+
return new APIPromise($do(
|
|
52
|
+
client$,
|
|
53
|
+
request,
|
|
54
|
+
options,
|
|
55
|
+
));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function $do(
|
|
59
|
+
client$: LightsageMcpCore,
|
|
60
|
+
request: V2AgentAnalyticsSummaryRetrieveRequest,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
Response,
|
|
66
|
+
| APIError
|
|
67
|
+
| SDKValidationError
|
|
68
|
+
| UnexpectedClientError
|
|
69
|
+
| InvalidRequestError
|
|
70
|
+
| RequestAbortedError
|
|
71
|
+
| RequestTimeoutError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed$ = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value$) => V2AgentAnalyticsSummaryRetrieveRequest$zodSchema.parse(value$),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed$.ok) {
|
|
83
|
+
return [parsed$, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload$ = parsed$.value;
|
|
86
|
+
const body$ = null;
|
|
87
|
+
|
|
88
|
+
const pathParams$ = {
|
|
89
|
+
site_id: encodeSimple("site_id", payload$.site_id, {
|
|
90
|
+
explode: false,
|
|
91
|
+
charEncoding: "percent",
|
|
92
|
+
}),
|
|
93
|
+
};
|
|
94
|
+
const path$ = pathToFunc("/v2/agent-analytics/sites/{site_id}/summary")(
|
|
95
|
+
pathParams$,
|
|
96
|
+
);
|
|
97
|
+
const query$ = encodeFormQuery({
|
|
98
|
+
"end_date": payload$.end_date,
|
|
99
|
+
"start_date": payload$.start_date,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const headers$ = new Headers(compactMap({
|
|
103
|
+
Accept: "application/json",
|
|
104
|
+
}));
|
|
105
|
+
const securityInput = await extractSecurity(client$._options.security);
|
|
106
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
107
|
+
|
|
108
|
+
const context = {
|
|
109
|
+
options: client$._options,
|
|
110
|
+
baseURL: options?.serverURL ?? client$._baseURL ?? "",
|
|
111
|
+
operationID: "v2_agent_analytics_summary_retrieve",
|
|
112
|
+
oAuth2Scopes: null,
|
|
113
|
+
resolvedSecurity: requestSecurity,
|
|
114
|
+
securitySource: client$._options.security,
|
|
115
|
+
retryConfig: options?.retries
|
|
116
|
+
|| client$._options.retryConfig
|
|
117
|
+
|| { strategy: "none" },
|
|
118
|
+
retryCodes: options?.retryCodes || [
|
|
119
|
+
"429",
|
|
120
|
+
"500",
|
|
121
|
+
"502",
|
|
122
|
+
"503",
|
|
123
|
+
"504",
|
|
124
|
+
],
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const requestRes = client$._createRequest(context, {
|
|
128
|
+
security: requestSecurity,
|
|
129
|
+
method: "GET",
|
|
130
|
+
baseURL: options?.serverURL,
|
|
131
|
+
path: path$,
|
|
132
|
+
headers: headers$,
|
|
133
|
+
query: query$,
|
|
134
|
+
body: body$,
|
|
135
|
+
userAgent: client$._options.userAgent,
|
|
136
|
+
timeoutMs: options?.timeoutMs || client$._options.timeoutMs
|
|
137
|
+
|| -1,
|
|
138
|
+
}, options);
|
|
139
|
+
if (!requestRes.ok) {
|
|
140
|
+
return [requestRes, { status: "invalid" }];
|
|
141
|
+
}
|
|
142
|
+
const req$ = requestRes.value;
|
|
143
|
+
|
|
144
|
+
const doResult = await client$._do(req$, {
|
|
145
|
+
context,
|
|
146
|
+
errorCodes: [],
|
|
147
|
+
retryConfig: context.retryConfig,
|
|
148
|
+
retryCodes: context.retryCodes,
|
|
149
|
+
});
|
|
150
|
+
if (!doResult.ok) {
|
|
151
|
+
return [doResult, { status: "request-error", request: req$ }];
|
|
152
|
+
}
|
|
153
|
+
return [doResult, {
|
|
154
|
+
status: "complete",
|
|
155
|
+
"request": req$,
|
|
156
|
+
response: doResult.value,
|
|
157
|
+
}];
|
|
158
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 0e59c249fad2
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { LightsageMcpCore } from "../core.js";
|
|
7
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
CreateTaskRequest,
|
|
15
|
+
CreateTaskRequest$zodSchema,
|
|
16
|
+
} from "../models/createtaskrequest.js";
|
|
17
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
18
|
+
import {
|
|
19
|
+
ConnectionError,
|
|
20
|
+
InvalidRequestError,
|
|
21
|
+
RequestAbortedError,
|
|
22
|
+
RequestTimeoutError,
|
|
23
|
+
UnexpectedClientError,
|
|
24
|
+
} from "../models/errors/httpclienterrors.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Create Task
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Adds a task to today's queue and returns it with its execution prompt. New tasks start as `new`.
|
|
34
|
+
*/
|
|
35
|
+
export function tasksCreate(
|
|
36
|
+
client$: LightsageMcpCore,
|
|
37
|
+
request: CreateTaskRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
Response,
|
|
42
|
+
| APIError
|
|
43
|
+
| SDKValidationError
|
|
44
|
+
| UnexpectedClientError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| ConnectionError
|
|
49
|
+
>
|
|
50
|
+
> {
|
|
51
|
+
return new APIPromise($do(
|
|
52
|
+
client$,
|
|
53
|
+
request,
|
|
54
|
+
options,
|
|
55
|
+
));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function $do(
|
|
59
|
+
client$: LightsageMcpCore,
|
|
60
|
+
request: CreateTaskRequest,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
Response,
|
|
66
|
+
| APIError
|
|
67
|
+
| SDKValidationError
|
|
68
|
+
| UnexpectedClientError
|
|
69
|
+
| InvalidRequestError
|
|
70
|
+
| RequestAbortedError
|
|
71
|
+
| RequestTimeoutError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed$ = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value$) => CreateTaskRequest$zodSchema.parse(value$),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed$.ok) {
|
|
83
|
+
return [parsed$, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload$ = parsed$.value;
|
|
86
|
+
const body$ = encodeJSON("body", payload$, { explode: true });
|
|
87
|
+
const path$ = pathToFunc("/v2/tasks")();
|
|
88
|
+
|
|
89
|
+
const headers$ = new Headers(compactMap({
|
|
90
|
+
"Content-Type": "application/json",
|
|
91
|
+
Accept: "application/json",
|
|
92
|
+
}));
|
|
93
|
+
const securityInput = await extractSecurity(client$._options.security);
|
|
94
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
95
|
+
|
|
96
|
+
const context = {
|
|
97
|
+
options: client$._options,
|
|
98
|
+
baseURL: options?.serverURL ?? client$._baseURL ?? "",
|
|
99
|
+
operationID: "v2_tasks_create",
|
|
100
|
+
oAuth2Scopes: null,
|
|
101
|
+
resolvedSecurity: requestSecurity,
|
|
102
|
+
securitySource: client$._options.security,
|
|
103
|
+
retryConfig: options?.retries
|
|
104
|
+
|| client$._options.retryConfig
|
|
105
|
+
|| { strategy: "none" },
|
|
106
|
+
retryCodes: options?.retryCodes || [
|
|
107
|
+
"429",
|
|
108
|
+
"500",
|
|
109
|
+
"502",
|
|
110
|
+
"503",
|
|
111
|
+
"504",
|
|
112
|
+
],
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const requestRes = client$._createRequest(context, {
|
|
116
|
+
security: requestSecurity,
|
|
117
|
+
method: "POST",
|
|
118
|
+
baseURL: options?.serverURL,
|
|
119
|
+
path: path$,
|
|
120
|
+
headers: headers$,
|
|
121
|
+
body: body$,
|
|
122
|
+
userAgent: client$._options.userAgent,
|
|
123
|
+
timeoutMs: options?.timeoutMs || client$._options.timeoutMs
|
|
124
|
+
|| -1,
|
|
125
|
+
}, options);
|
|
126
|
+
if (!requestRes.ok) {
|
|
127
|
+
return [requestRes, { status: "invalid" }];
|
|
128
|
+
}
|
|
129
|
+
const req$ = requestRes.value;
|
|
130
|
+
|
|
131
|
+
const doResult = await client$._do(req$, {
|
|
132
|
+
context,
|
|
133
|
+
errorCodes: [],
|
|
134
|
+
retryConfig: context.retryConfig,
|
|
135
|
+
retryCodes: context.retryCodes,
|
|
136
|
+
});
|
|
137
|
+
if (!doResult.ok) {
|
|
138
|
+
return [doResult, { status: "request-error", request: req$ }];
|
|
139
|
+
}
|
|
140
|
+
return [doResult, {
|
|
141
|
+
status: "complete",
|
|
142
|
+
"request": req$,
|
|
143
|
+
response: doResult.value,
|
|
144
|
+
}];
|
|
145
|
+
}
|
package/src/landing-page.ts
CHANGED
|
@@ -931,7 +931,7 @@ http_headers = { "lightsage-api-key-auth" = "YOUR_LIGHTSAGE_API_KEY_AUTH" }`;
|
|
|
931
931
|
<h1>Instructions</h1>
|
|
932
932
|
<p>One-click installation for Claude Desktop users</p>
|
|
933
933
|
<div class="instruction-item">
|
|
934
|
-
<a href="https://github.com/lightsagehq/mcp/releases/download/v0.4.
|
|
934
|
+
<a href="https://github.com/lightsagehq/mcp/releases/download/v0.4.17/mcp-server.mcpb" download="mcp-server.mcpb" class="action-button header-action" style="display: inline-flex; margin-bottom: 16px;">
|
|
935
935
|
📥 Download MCP Bundle
|
|
936
936
|
</a>
|
|
937
937
|
</div>
|
package/src/lib/config.ts
CHANGED
|
@@ -66,7 +66,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
66
66
|
export const SDK_METADATA = {
|
|
67
67
|
language: "typescript",
|
|
68
68
|
openapiDocVersion: "1.0.0",
|
|
69
|
-
sdkVersion: "0.4.
|
|
69
|
+
sdkVersion: "0.4.17",
|
|
70
70
|
genVersion: "2.948.4",
|
|
71
|
-
userAgent: "speakeasy-sdk/mcp-typescript 0.4.
|
|
71
|
+
userAgent: "speakeasy-sdk/mcp-typescript 0.4.17 2.948.4 1.0.0 @lightsage/mcp",
|
|
72
72
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -18,6 +18,12 @@ import {
|
|
|
18
18
|
MCPToolAnnotationFilter,
|
|
19
19
|
registerDynamicTools,
|
|
20
20
|
} from "./tools.js";
|
|
21
|
+
import { tool$agentAnalyticsCountriesList } from "./tools/agentAnalyticsCountriesList.js";
|
|
22
|
+
import { tool$agentAnalyticsErrorPagesList } from "./tools/agentAnalyticsErrorPagesList.js";
|
|
23
|
+
import { tool$agentAnalyticsPagesList } from "./tools/agentAnalyticsPagesList.js";
|
|
24
|
+
import { tool$agentAnalyticsSitesList } from "./tools/agentAnalyticsSitesList.js";
|
|
25
|
+
import { tool$agentAnalyticsSourcesList } from "./tools/agentAnalyticsSourcesList.js";
|
|
26
|
+
import { tool$agentAnalyticsSummaryRetrieve } from "./tools/agentAnalyticsSummaryRetrieve.js";
|
|
21
27
|
import { tool$agentPreferenceCompetitorsList } from "./tools/agentPreferenceCompetitorsList.js";
|
|
22
28
|
import { tool$agentPreferenceEvalsCreate } from "./tools/agentPreferenceEvalsCreate.js";
|
|
23
29
|
import { tool$agentPreferenceEvalsDelete } from "./tools/agentPreferenceEvalsDelete.js";
|
|
@@ -76,6 +82,7 @@ import { tool$siteAuditsRetrieve } from "./tools/siteAuditsRetrieve.js";
|
|
|
76
82
|
import { tool$skillsList } from "./tools/skillsList.js";
|
|
77
83
|
import { tool$statusAuthStatusGet } from "./tools/statusAuthStatusGet.js";
|
|
78
84
|
import { tool$statusGet } from "./tools/statusGet.js";
|
|
85
|
+
import { tool$tasksCreate } from "./tools/tasksCreate.js";
|
|
79
86
|
import { tool$tasksList } from "./tools/tasksList.js";
|
|
80
87
|
import { tool$tasksRetrieve } from "./tools/tasksRetrieve.js";
|
|
81
88
|
import { tool$tasksUpdate } from "./tools/tasksUpdate.js";
|
|
@@ -103,7 +110,7 @@ export function createMCPServer(deps: {
|
|
|
103
110
|
sizes: ["any"],
|
|
104
111
|
}],
|
|
105
112
|
name: "LightsageMcp",
|
|
106
|
-
version: "0.4.
|
|
113
|
+
version: "0.4.17",
|
|
107
114
|
});
|
|
108
115
|
|
|
109
116
|
const getClient = deps.getSDK || (() =>
|
|
@@ -170,10 +177,17 @@ export function createMCPServer(deps: {
|
|
|
170
177
|
tool(tool$opportunitiesList);
|
|
171
178
|
tool(tool$opportunitiesRetrieve);
|
|
172
179
|
tool(tool$tasksList);
|
|
180
|
+
tool(tool$tasksCreate);
|
|
173
181
|
tool(tool$tasksRetrieve);
|
|
174
182
|
tool(tool$tasksUpdate);
|
|
175
183
|
tool(tool$siteAuditsList);
|
|
176
184
|
tool(tool$siteAuditsRetrieve);
|
|
185
|
+
tool(tool$agentAnalyticsSitesList);
|
|
186
|
+
tool(tool$agentAnalyticsSummaryRetrieve);
|
|
187
|
+
tool(tool$agentAnalyticsSourcesList);
|
|
188
|
+
tool(tool$agentAnalyticsPagesList);
|
|
189
|
+
tool(tool$agentAnalyticsErrorPagesList);
|
|
190
|
+
tool(tool$agentAnalyticsCountriesList);
|
|
177
191
|
tool(tool$evalsList);
|
|
178
192
|
tool(tool$evalsCreate);
|
|
179
193
|
tool(tool$evalsBatchCreate);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 0da30e8db89f
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { agentAnalyticsCountriesList } from "../../funcs/agentAnalyticsCountriesList.js";
|
|
7
|
+
import { V2AgentAnalyticsCountriesListRequest$zodSchema } from "../../models/v2agentanalyticscountrieslistop.js";
|
|
8
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
9
|
+
|
|
10
|
+
const args = {
|
|
11
|
+
request: V2AgentAnalyticsCountriesListRequest$zodSchema,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const tool$agentAnalyticsCountriesList: ToolDefinition<typeof args> = {
|
|
15
|
+
name: "agent-analytics-countries-list",
|
|
16
|
+
description: `List Agent Analytics Countries
|
|
17
|
+
|
|
18
|
+
Returns a site's visits from coding agents and AI assistants per country in the date range, most visits first.`,
|
|
19
|
+
annotations: {
|
|
20
|
+
"title": "",
|
|
21
|
+
"destructiveHint": false,
|
|
22
|
+
"idempotentHint": false,
|
|
23
|
+
"openWorldHint": false,
|
|
24
|
+
"readOnlyHint": true,
|
|
25
|
+
},
|
|
26
|
+
args,
|
|
27
|
+
tool: async (client, args, ctx) => {
|
|
28
|
+
const [result] = await agentAnalyticsCountriesList(
|
|
29
|
+
client,
|
|
30
|
+
args.request,
|
|
31
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
32
|
+
).$inspect();
|
|
33
|
+
|
|
34
|
+
if (!result.ok) {
|
|
35
|
+
return {
|
|
36
|
+
content: [{ type: "text", text: result.error.message }],
|
|
37
|
+
isError: true,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return formatResult(result.value);
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: d33d2c1a70a9
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { agentAnalyticsErrorPagesList } from "../../funcs/agentAnalyticsErrorPagesList.js";
|
|
7
|
+
import { V2AgentAnalyticsErrorPagesListRequest$zodSchema } from "../../models/v2agentanalyticserrorpageslistop.js";
|
|
8
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
9
|
+
|
|
10
|
+
const args = {
|
|
11
|
+
request: V2AgentAnalyticsErrorPagesListRequest$zodSchema,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const tool$agentAnalyticsErrorPagesList: ToolDefinition<typeof args> = {
|
|
15
|
+
name: "agent-analytics-error-pages-list",
|
|
16
|
+
description: `List Agent Analytics Error Pages
|
|
17
|
+
|
|
18
|
+
Returns the pages on a site that returned an error status (400 and up) in the date range, most error requests first, with the agents, bots, and people that got each error. Set \`status\` to 404 for pages that were not found. Needs server-side tracking that records status codes; \`status_codes_tracked\` says whether the site has any.`,
|
|
19
|
+
annotations: {
|
|
20
|
+
"title": "",
|
|
21
|
+
"destructiveHint": false,
|
|
22
|
+
"idempotentHint": false,
|
|
23
|
+
"openWorldHint": false,
|
|
24
|
+
"readOnlyHint": true,
|
|
25
|
+
},
|
|
26
|
+
args,
|
|
27
|
+
tool: async (client, args, ctx) => {
|
|
28
|
+
const [result] = await agentAnalyticsErrorPagesList(
|
|
29
|
+
client,
|
|
30
|
+
args.request,
|
|
31
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
32
|
+
).$inspect();
|
|
33
|
+
|
|
34
|
+
if (!result.ok) {
|
|
35
|
+
return {
|
|
36
|
+
content: [{ type: "text", text: result.error.message }],
|
|
37
|
+
isError: true,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return formatResult(result.value);
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 057773705e6c
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { agentAnalyticsPagesList } from "../../funcs/agentAnalyticsPagesList.js";
|
|
7
|
+
import { V2AgentAnalyticsPagesListRequest$zodSchema } from "../../models/v2agentanalyticspageslistop.js";
|
|
8
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
9
|
+
|
|
10
|
+
const args = {
|
|
11
|
+
request: V2AgentAnalyticsPagesListRequest$zodSchema,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const tool$agentAnalyticsPagesList: ToolDefinition<typeof args> = {
|
|
15
|
+
name: "agent-analytics-pages-list",
|
|
16
|
+
description: `List Agent Analytics Pages
|
|
17
|
+
|
|
18
|
+
Returns the pages AI agents and bots read on a site in the date range, with visits per traffic type. Sorted by AI visits unless \`sort\` is set. With \`type\`, returns only pages that traffic type visited. With \`agent\`, returns only the pages that one coding agent read.`,
|
|
19
|
+
annotations: {
|
|
20
|
+
"title": "",
|
|
21
|
+
"destructiveHint": false,
|
|
22
|
+
"idempotentHint": false,
|
|
23
|
+
"openWorldHint": false,
|
|
24
|
+
"readOnlyHint": true,
|
|
25
|
+
},
|
|
26
|
+
args,
|
|
27
|
+
tool: async (client, args, ctx) => {
|
|
28
|
+
const [result] = await agentAnalyticsPagesList(
|
|
29
|
+
client,
|
|
30
|
+
args.request,
|
|
31
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
32
|
+
).$inspect();
|
|
33
|
+
|
|
34
|
+
if (!result.ok) {
|
|
35
|
+
return {
|
|
36
|
+
content: [{ type: "text", text: result.error.message }],
|
|
37
|
+
isError: true,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return formatResult(result.value);
|
|
42
|
+
},
|
|
43
|
+
};
|