Skip to main content
Glama

Storyden

by Southclaws
Mozilla Public License 2.0
229
mutation.ts1.09 kB
import { Arguments, MutatorCallback, useSWRConfig } from "swr"; import { accountUpdate } from "@/api/openapi-client/accounts"; import { getProfileGetKey } from "@/api/openapi-client/profiles"; import { AccountMutableProps, ProfileGetOKResponse, } from "@/api/openapi-schema"; export function useProfileMutations(handle: string) { const { mutate } = useSWRConfig(); const profileKey = getProfileGetKey(handle); function keyFilterFn(key: Arguments) { return Array.isArray(key) && key[0].startsWith(profileKey); } const revalidate = async (data?: MutatorCallback<ProfileGetOKResponse>) => { await mutate(keyFilterFn, data); }; const update = async (updated: AccountMutableProps) => { const mutator: MutatorCallback<ProfileGetOKResponse> = (data) => { if (!data) return; const newData = { ...data, ...updated, } as ProfileGetOKResponse; return newData; }; await mutate(profileKey, mutator, { revalidate: false, }); await accountUpdate(updated); }; return { revalidate, update, }; }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Southclaws/storyden'

If you have feedback or need assistance with the MCP directory API, please join our Discord server