@findtime/mcp-server 3.25.5 → 3.25.7
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/package.json +1 -1
- package/server.js +53 -0
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -33,6 +33,18 @@ const DEFAULT_API_KEY = firstNonEmpty(
|
|
|
33
33
|
const TIMEZONE_HELPERS_PATH = path.join(REPO_ROOT, 'slack-bot', 'timezone-helpers.js');
|
|
34
34
|
|
|
35
35
|
const TOOL_DEFINITIONS = [
|
|
36
|
+
{
|
|
37
|
+
name: 'get_api_diagnostics',
|
|
38
|
+
description: 'Return MCP and findtime Time API diagnostics, including package version, API base URL, auth configuration, and a live health check.',
|
|
39
|
+
inputSchema: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: {},
|
|
42
|
+
additionalProperties: false
|
|
43
|
+
},
|
|
44
|
+
buildRequest() {
|
|
45
|
+
return { path: '/health', params: new URLSearchParams() };
|
|
46
|
+
}
|
|
47
|
+
},
|
|
36
48
|
{
|
|
37
49
|
name: 'time_snapshot',
|
|
38
50
|
description: 'Return the production time snapshot payload for one location or a list of locations.',
|
|
@@ -131,6 +143,10 @@ const TOOL_DEFINITIONS = [
|
|
|
131
143
|
at: {
|
|
132
144
|
type: 'string',
|
|
133
145
|
description: 'Optional ISO timestamp used as the reference instant.'
|
|
146
|
+
},
|
|
147
|
+
year: {
|
|
148
|
+
type: 'integer',
|
|
149
|
+
description: 'Optional calendar year used to return DST transitions for that civil year.'
|
|
134
150
|
}
|
|
135
151
|
},
|
|
136
152
|
additionalProperties: false
|
|
@@ -143,6 +159,7 @@ const TOOL_DEFINITIONS = [
|
|
|
143
159
|
setParam(params, 'timezone', args.timezone);
|
|
144
160
|
setParam(params, 'countryCode', args.countryCode);
|
|
145
161
|
setParam(params, 'at', args.at);
|
|
162
|
+
setParam(params, 'year', args.year);
|
|
146
163
|
return { path: '/timezone/dst', params };
|
|
147
164
|
}
|
|
148
165
|
},
|
|
@@ -807,6 +824,42 @@ function createFindtimeMcpServer(options = {}) {
|
|
|
807
824
|
throw invalidParamsError(`Unknown tool: ${name}`);
|
|
808
825
|
}
|
|
809
826
|
|
|
827
|
+
if (name === 'get_api_diagnostics') {
|
|
828
|
+
const request = tool.buildRequest(args || {});
|
|
829
|
+
const apiResponse = await fetchJson(name, request);
|
|
830
|
+
const checkedAt = new Date().toISOString();
|
|
831
|
+
const diagnostics = {
|
|
832
|
+
ok: apiResponse.ok,
|
|
833
|
+
tool: name,
|
|
834
|
+
checkedAt,
|
|
835
|
+
mcpVersion: SERVER_VERSION,
|
|
836
|
+
apiBaseUrl,
|
|
837
|
+
apiConfigured: Boolean(apiBaseUrl),
|
|
838
|
+
apiAuthConfigured: Boolean(typeof apiKey === 'string' && apiKey.trim()),
|
|
839
|
+
clientType: firstNonEmpty(
|
|
840
|
+
process.env.FINDTIME_MCP_CLIENT_TYPE,
|
|
841
|
+
process.env.TIME_API_CLIENT_TYPE
|
|
842
|
+
) || null,
|
|
843
|
+
apiHealthUrl: apiResponse.url,
|
|
844
|
+
apiStatus: apiResponse.status,
|
|
845
|
+
apiReachable: apiResponse.ok
|
|
846
|
+
};
|
|
847
|
+
|
|
848
|
+
if (apiResponse.ok) {
|
|
849
|
+
diagnostics.apiHealth = apiResponse.parsedBody;
|
|
850
|
+
} else {
|
|
851
|
+
diagnostics.error = apiResponse.parsedBody !== undefined ? apiResponse.parsedBody : apiResponse.rawBody;
|
|
852
|
+
if (apiResponse.networkError) {
|
|
853
|
+
diagnostics.networkError = apiResponse.networkError;
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
return buildToolSuccessResult(name, diagnostics, {
|
|
858
|
+
endpoint: request.path,
|
|
859
|
+
url: apiResponse.url
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
|
|
810
863
|
const request = tool.buildRequest(args || {});
|
|
811
864
|
let apiResponse = await fetchJson(name, request);
|
|
812
865
|
|