Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

fix: complete API and MCP discovery contracts

Amruth Pillai2b98ec49a7cc
diff --git a/apps/server/src/openapi/generator.test.ts b/apps/server/src/openapi/generator.test.ts
index 9b9318218..3ddee5cd4 100644
--- a/apps/server/src/openapi/generator.test.ts
+++ b/apps/server/src/openapi/generator.test.ts
@@ -14,6 +14,8 @@ type GeneratedSpecView = {
Record<
string,
{
+ summary?: string;
+ description?: string;
requestBody?: {
content?: Record<string, { schema?: unknown }>;
};
@@ -70,6 +72,18 @@ function findImpossibleRequestSchemas(spec: GeneratedSpecView) {
}
describe("generateOpenApiSpec", () => {
+ it("describes every published HTTP operation", async () => {
+ const spec = (await generateSpec()) as GeneratedSpecView;
+ const missing: string[] = [];
+ for (const [path, operations] of Object.entries(spec.paths ?? {})) {
+ for (const [method, operation] of Object.entries(operations)) {
+ if (!["get", "post", "put", "patch", "delete"].includes(method)) continue;
+ if (!(operation.summary?.trim() || operation.description?.trim())) missing.push(`${method} ${path}`);
+ }
+ }
+ expect(missing).toEqual([]);
+ }, 15_000);
+
it("documents guaranteed profile response fields without adding request defaults", async () => {
const spec = await generateSpec();
for (const method of ["get", "put", "patch"] as const) {
diff --git a/docs/guides/using-the-mcp-server.mdx b/docs/guides/using-the-mcp-server.mdx
index 1f4c0b228..288df408c 100644
--- a/docs/guides/using-the-mcp-server.mdx
+++ b/docs/guides/using-the-mcp-server.mdx
@@ -272,7 +272,7 @@ The server reads storage directly and verifies the account prefix and path segme
### Browser and streaming workflows
-`open_account_settings` opens profile, security, API keys, preferences or account settings. Provider creation/update and web credential entry return their authenticated settings page. `api_resume_set_password` returns the resume's editor link, where you set, change or remove its share password, and `api_resume_verify_password` returns a password-protected public resume's link, where a visitor enters the password. Account deletion, password changes, passkeys, two-factor authentication and provider credentials require user interaction in that browser. Browser preferences, local undo and document selection remain browser workflows; durable edits and history are available through MCP.
+`open_account_settings` opens account, security, AI & developer, API keys, connected applications or preferences. Use the `page` argument, such as `{"page":"api-keys"}`; `section` and other unknown fields are rejected. Older `profile` and `authentication` page names still work. Provider creation/update and web credential entry return their authenticated settings page. `api_resume_set_password` returns the resume's editor link, where you set, change or remove its share password, and `api_resume_verify_password` returns a password-protected public resume's link, where a visitor enters the password. Account deletion, password changes, passkeys, two-factor authentication and provider credentials require user interaction in that browser. Browser preferences, local undo and document selection remain browser workflows; durable edits and history are available through MCP.
MCP is stateless and accepts POST requests with JSON responses. GET/DELETE return 405; there is no standalone SSE subscription. Draft/message streams are collected up to 500,000 characters; `truncated` identifies longer responses. Read the assistant thread for persisted replies. To watch a resume for changes, poll `read_resume` and compare `updatedAt`.
diff --git a/docs/spec.json b/docs/spec.json
index 1cb09b818..434984120 100644
--- a/docs/spec.json
+++ b/docs/spec.json
@@ -1679,6 +1679,7 @@
"/ai/capabilities": {
"get": {
"operationId": "getAiCapabilities",
+ "summary": "Get supported AI consent and web-search capabilities",
"tags": [
"AI"
],
@@ -43199,6 +43200,7 @@
"/applications/{id}/ai/evidence-proposal": {
"post": {
"operationId": "applications.ai.proposeEvidence",
+ "summary": "Propose reviewed resume edits from selected application evidence",
"tags": [
"Applications",
"AI"
diff --git a/packages/api/src/features/ai/router.ts b/packages/api/src/features/ai/router.ts
index 54ee343e3..914587e77 100644
--- a/packages/api/src/features/ai/router.ts
+++ b/packages/api/src/features/ai/router.ts
@@ -77,7 +77,13 @@ export const aiRouter = {
.handler(({ context, input }) => readWeeklyAiUsage(context.user.id, undefined, input.includeWebSearch)),
reportContent: reportAiContent,
capabilities: protectedProcedure
- .route({ method: "GET", path: "/ai/capabilities", tags: ["AI"], operationId: "getAiCapabilities" })
+ .route({
+ method: "GET",
+ path: "/ai/capabilities",
+ tags: ["AI"],
+ operationId: "getAiCapabilities",
+ summary: "Get supported AI consent and web-search capabilities",
+ })
.input(z.object({}).default({}))
.output(z.object({ recipientApproval: z.literal(1), explicitNoAi: z.literal(true), nativeWebSearch: z.literal(1) }))
.handler(() => ({ recipientApproval: 1 as const, explicitNoAi: true as const, nativeWebSearch: 1 as const })),
diff --git a/packages/api/src/features/applications/ai.ts b/packages/api/src/features/applications/ai.ts
index 5532085eb..dd2c20f11 100644
--- a/packages/api/src/features/applications/ai.ts
+++ b/packages/api/src/features/applications/ai.ts
@@ -541,7 +541,12 @@ export const aiRouter = {
),
proposeEvidence: protectedProcedure
- .route({ method: "POST", path: "/applications/{id}/ai/evidence-proposal", ...reserved })
+ .route({
+ method: "POST",
+ path: "/applications/{id}/ai/evidence-proposal",
+ ...reserved,
+ summary: "Propose reviewed resume edits from selected application evidence",
+ })
.input(z.object({ id: z.string(), factId: z.string() }))
.use(aiRequestRateLimit)
.output(applicationDto.tailorResume.output)
diff --git a/packages/mcp/src/parity.test.ts b/packages/mcp/src/parity.test.ts
index 5df685167..840e00291 100644
--- a/packages/mcp/src/parity.test.ts
+++ b/packages/mcp/src/parity.test.ts
@@ -74,6 +74,27 @@ it("hands account deletion to browser settings without invoking the API", async
expect(calls.auth.deleteAccount).not.toHaveBeenCalled();
});
+it("rejects misspelled settings arguments and keeps legacy page names on current routes", async () => {
+ const invalid = await client.callTool({ name: "open_account_settings", arguments: { section: "api-keys" } });
+ expect(invalid.isError).toBe(true);
+ expect(JSON.stringify(invalid.content)).toContain("section");
+ for (const [page, path] of Object.entries({
+ account: "/dashboard/settings/account",
+ profile: "/dashboard/settings/account",
+ security: "/dashboard/settings/account#security",
+ authentication: "/dashboard/settings/account#security",
+ preferences: "/dashboard/settings/preferences",
+ ai: "/dashboard/settings/ai",
+ "api-keys": "/dashboard/settings/ai#api-keys",
+ "connected-applications": "/dashboard/settings/ai#connected-applications",
+ })) {
+ const result = await client.callTool({ name: "open_account_settings", arguments: { page } });
+ expect(result.isError).not.toBe(true);
+ const url = new URL((result.structuredContent as { url: string }).url);
+ expect(url.pathname + url.hash).toBe(path);
+ }
+});
+
it("discovers API-derived contracts and exchanges native files and dates through the SDK", async () => {
const { tools } = await client.listTools();
const cardTools = new Map(buildMcpServerCard("1.0.0").tools.map((tool) => [tool.name, tool]));
diff --git a/packages/mcp/src/parity.ts b/packages/mcp/src/parity.ts
index b5154f71f..4eaba62db 100644
--- a/packages/mcp/src/parity.ts
+++ b/packages/mcp/src/parity.ts
@@ -190,7 +190,7 @@ const handoffOutputSchema = z.object({ url: z.url(), action: z.string(), require
/** Where each settings page or group lives now. `authentication` is the old name for `security`, kept for clients. */
const ACCOUNT_SETTINGS_PATHS = {
account: "/dashboard/settings/account",
- profile: "/dashboard/settings/profile",
+ profile: "/dashboard/settings/account",
security: "/dashboard/settings/account#security",
authentication: "/dashboard/settings/account#security",
preferences: "/dashboard/settings/preferences",
@@ -202,7 +202,7 @@ const accountToolMeta = {
title: "Open account settings",
description:
"Open a settings page or group: account, profile, security, preferences, ai (AI providers and web access), api-keys or connected-applications. Authentication changes require the user's browser interaction.",
- inputSchema: z.object({
+ inputSchema: z.strictObject({
page: z
.enum(
Object.keys(ACCOUNT_SETTINGS_PATHS) as [