get_applications
Retrieve all applications from the DevOps Plan system to manage and view available software projects and components.
Instructions
Retrieves all applications from the Plan system
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- old-server.js:577-625 (handler)The implementation of the get_applications tool, which retrieves applications by querying the Plan system's databases API endpoint.
server.tool( "get_applications", "Retrieves all applications from the Plan system", {}, async () => { try { if (!globalCookies) { globalCookies = await getCookiesFromServer(serverURL); if (!globalCookies) { console.error("Failed to retrieve cookies from server."); return { error: "Failed to retrieve cookies." }; } console.log("Received Cookies:", globalCookies); // Print cookies after receiving } else { console.log("Reusing Stored Cookies:", globalCookies); // Print when reusing stored cookies } const response = await fetch(`${serverURL}/ccmweb/rest/repos/${teamspaceID}/databases`, { method: 'GET', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': `Basic ${personal_access_token_string}`, 'Cookie': globalCookies } }); const data = await response.json(); if (data && Array.isArray(data)) { const applications = data.map(app => ({ id: app.dbId, applicationName: app.name })); return { content: [ { type: 'text', text: `Applications retrieved: ${JSON.stringify(applications)}` } ] }; } else { throw new Error("Failed to retrieve applications"); } } catch (e) { return { content: [{ type: 'text', text: `Error retrieving applications: ${e.message}` }] }; } } );