MCPcopy Index your code
hub / github.com/kagent-dev/kagent / listNamespaces

Function listNamespaces

ui/src/app/actions/namespaces.ts:16–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14 * @returns A promise with the list of namespaces
15 */
16export async function listNamespaces(): Promise<BaseResponse<NamespaceResponse[]>> {
17 try {
18 const response = await fetchApi<BaseResponse<NamespaceResponse[]>>('/namespaces');
19
20 if (!response) {
21 throw new Error("Failed to get namespaces");
22 }
23
24 return {
25 message: "Namespaces fetched successfully",
26 data: response.data,
27 };
28 } catch (error) {
29 return createErrorResponse<NamespaceResponse[]>(error, "Error getting namespaces");
30 }
31}

Callers 1

loadNamespacesFunction · 0.90

Calls 1

createErrorResponseFunction · 0.90

Tested by

no test coverage detected