MCPcopy Create free account
hub / github.com/Noumena-Network/code / updateSessionTitle

Function updateSessionTitle

src/utils/teleport/api.ts:519–560  ·  view source on GitHub ↗
(
  sessionId: string,
  title: string,
)

Source from the content-addressed store, hash-verified

517 * @returns Promise<boolean> True if successful, false otherwise
518 */
519export async function updateSessionTitle(
520 sessionId: string,
521 title: string,
522): Promise<boolean> {
523 try {
524 const { accessToken, orgUUID } = await prepareApiRequest()
525
526 const url = buildNoumenaPlatformUrl(`/v1/sessions/${sessionId}`)
527 const headers = {
528 ...getOAuthHeaders(accessToken),
529 'anthropic-beta': 'ccr-byoc-2025-07-29',
530 'x-organization-uuid': orgUUID,
531 }
532
533 logForDebugging(
534 `[updateSessionTitle] Updating title for session ${sessionId}: "${title}"`,
535 )
536 const response = await axios.patch(
537 url,
538 { title },
539 {
540 headers,
541 validateStatus: status => status < 500,
542 },
543 )
544
545 if (response.status === 200) {
546 logForDebugging(
547 `[updateSessionTitle] Successfully updated title for session ${sessionId}`,
548 )
549 return true
550 }
551
552 logForDebugging(
553 `[updateSessionTitle] Failed with status ${response.status}: ${jsonStringify(response.data)}`,
554 )
555 return false
556 } catch (error) {
557 logForDebugging(`[updateSessionTitle] Error: ${errorMessage(error)}`)
558 return false
559 }
560}

Callers 1

useRemoteSessionFunction · 0.85

Calls 6

prepareApiRequestFunction · 0.85
buildNoumenaPlatformUrlFunction · 0.85
getOAuthHeadersFunction · 0.85
jsonStringifyFunction · 0.85
logForDebuggingFunction · 0.50
errorMessageFunction · 0.50

Tested by

no test coverage detected