MCPcopy
hub / github.com/upstash/context7 / getSkillQuota

Function getSkillQuota

packages/cli/src/utils/api.ts:119–137  ·  view source on GitHub ↗
(accessToken: string)

Source from the content-addressed store, hash-verified

117}
118
119export async function getSkillQuota(accessToken: string): Promise<SkillQuotaResponse> {
120 const response = await fetch(`${baseUrl}/api/v2/skills/quota`, {
121 headers: { Authorization: `Bearer ${accessToken}` },
122 });
123
124 if (!response.ok) {
125 const errorData = await response.json().catch(() => ({}));
126 return {
127 used: 0,
128 limit: 0,
129 remaining: 0,
130 tier: "free",
131 resetDate: null,
132 error: (errorData as { message?: string }).message || `HTTP error ${response.status}`,
133 };
134 }
135
136 return (await response.json()) as SkillQuotaResponse;
137}
138
139export async function getSkillQuestions(
140 libraries: Array<{ id: string; name: string }>,

Callers 1

generateCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected