MCPcopy Create free account
hub / github.com/getsentry/XcodeBuildMCP / sessionStatusResourceLogic

Function sessionStatusResourceLogic

src/mcp/resources/session-status.ts:11–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9import { getSessionRuntimeStatusSnapshot } from '../../utils/session-status.ts';
10
11export async function sessionStatusResourceLogic(): Promise<{ contents: Array<{ text: string }> }> {
12 try {
13 log('info', 'Processing session status resource request');
14 const status = await getSessionRuntimeStatusSnapshot();
15
16 return {
17 contents: [
18 {
19 text: JSON.stringify(status, null, 2),
20 },
21 ],
22 };
23 } catch (error) {
24 const errorMessage = toErrorMessage(error);
25 log('error', `Error in session status resource handler: ${errorMessage}`);
26
27 return {
28 contents: [
29 {
30 text: `Error retrieving session status: ${errorMessage}`,
31 },
32 ],
33 };
34 }
35}
36
37export async function handler(_uri: URL): Promise<{ contents: Array<{ text: string }> }> {
38 return sessionStatusResourceLogic();

Callers 2

handlerFunction · 0.85

Calls 3

logFunction · 0.90
toErrorMessageFunction · 0.90

Tested by

no test coverage detected