@findtime/mcp-server 3.25.6 → 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 +48 -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.',
|
|
@@ -812,6 +824,42 @@ function createFindtimeMcpServer(options = {}) {
|
|
|
812
824
|
throw invalidParamsError(`Unknown tool: ${name}`);
|
|
813
825
|
}
|
|
814
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
|
+
|
|
815
863
|
const request = tool.buildRequest(args || {});
|
|
816
864
|
let apiResponse = await fetchJson(name, request);
|
|
817
865
|
|