Skip to content

Commit 9609ef7

Browse files
committed
feat(mcp): add user-friendly tools and direct Sanity client execution to MCP endpoint
1 parent 619a743 commit 9609ef7

2 files changed

Lines changed: 1038 additions & 71 deletions

File tree

‎apps/site/src/pages/.well-known/mcp/server-card.json.ts‎

Lines changed: 94 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,39 +37,90 @@ export const GET: APIRoute = async ({ locals }) => {
3737
},
3838
tools: [
3939
{
40-
name: "initial_context",
41-
title: "Initial Context",
40+
name: "search_content",
41+
title: "Search CodingCat.dev Content",
4242
description:
43-
"Get initial context, schema overview, and usage instructions for the CodingCat.dev Sanity dataset.",
43+
"Search CodingCat.dev podcasts, tutorials, blog articles, authors, guests, and video transcripts using hybrid semantic search and keyword ranking. ALWAYS use this tool first when asked to find, recommend, list, or search for content on a topic (e.g. 'Sanity', 'Vercel', 'Next.js', 'Astro', 'TypeScript', 'AI', 'Tailwind', etc.).",
4444
inputSchema: {
4545
type: "object",
46-
properties: {},
46+
properties: {
47+
query: {
48+
type: "string",
49+
description:
50+
"Search keywords, topic, or question (e.g. 'Sanity', 'Vercel', 'Next.js 15', 'Lee Robinson', 'Guillermo Rauch', 'AI agents').",
51+
},
52+
type: {
53+
type: "string",
54+
description:
55+
"Optional content type filter: 'all', 'podcast', 'post', 'author', 'guest'. Defaults to 'all'.",
56+
enum: ["all", "podcast", "post", "author", "guest"],
57+
},
58+
limit: {
59+
type: "integer",
60+
description: "Number of results to return (default: 10, max: 24).",
61+
},
62+
},
63+
required: ["query"],
4764
},
4865
},
4966
{
50-
name: "schema_explorer",
51-
title: "Schema Explorer",
67+
name: "get_content_by_slug",
68+
title: "Get Content by Slug",
5269
description:
53-
"Inspect a schema type's fields and structure in the CodingCat.dev Sanity dataset.",
70+
"Retrieve complete details, show notes, transcript summary, links, and guest/author metadata for a specific podcast episode or article by its slug.",
71+
inputSchema: {
72+
type: "object",
73+
properties: {
74+
slug: {
75+
type: "string",
76+
description:
77+
"The slug of the content item (e.g. '0-6-nextjs-with-guillermo-rauch', 'how-to-secure-vercel-cron-job-routes-in-next-js-14-app-router').",
78+
},
79+
},
80+
required: ["slug"],
81+
},
82+
},
83+
{
84+
name: "get_recent_content",
85+
title: "Get Recent Content",
86+
description:
87+
"Retrieve the most recently published podcast episodes or blog articles from CodingCat.dev, ordered by publication date.",
5488
inputSchema: {
5589
type: "object",
5690
properties: {
5791
type: {
5892
type: "string",
5993
description:
60-
"Schema type name (e.g., 'post', 'podcast', 'course', 'author').",
94+
"Content type filter: 'all', 'podcast', or 'post'. Defaults to 'all'.",
95+
enum: ["all", "podcast", "post"],
6196
},
62-
path: {
97+
limit: {
98+
type: "integer",
99+
description: "Number of items to return (default: 10, max: 20).",
100+
},
101+
},
102+
},
103+
},
104+
{
105+
name: "query_content",
106+
title: "Query Content Lake",
107+
description:
108+
"Execute a read-only query against the CodingCat.dev Sanity dataset. Supports GROQ queries such as count(*[_type == 'podcast']), *[_type == 'podcast'][0...5]{title, 'slug': slug.current}, or filtering by tags.",
109+
inputSchema: {
110+
type: "object",
111+
properties: {
112+
query: {
63113
type: "string",
64-
description: "Optional field path to navigate within the type.",
114+
description:
115+
"GROQ query to execute (e.g. count(*[_type == 'podcast']) or *[_type == 'guest'][0...10]{name, 'slug': slug.current}).",
65116
},
66117
},
67-
required: ["type"],
118+
required: ["query"],
68119
},
69120
},
70121
{
71122
name: "groq_query",
72-
title: "GROQ Query",
123+
title: "GROQ Query (Legacy / Advanced)",
73124
description:
74125
"Execute read-only GROQ queries against the CodingCat.dev Sanity Content Lake dataset.",
75126
inputSchema: {
@@ -83,6 +134,37 @@ export const GET: APIRoute = async ({ locals }) => {
83134
required: ["query"],
84135
},
85136
},
137+
{
138+
name: "initial_context",
139+
title: "Initial Context",
140+
description:
141+
"Get initial context, schema overview, and usage instructions for the CodingCat.dev Sanity dataset.",
142+
inputSchema: {
143+
type: "object",
144+
properties: {},
145+
},
146+
},
147+
{
148+
name: "schema_explorer",
149+
title: "Schema Explorer",
150+
description:
151+
"Inspect a schema type's fields and structure in the CodingCat.dev Sanity dataset.",
152+
inputSchema: {
153+
type: "object",
154+
properties: {
155+
type: {
156+
type: "string",
157+
description:
158+
"Schema type name (e.g., 'post', 'podcast', 'course', 'author').",
159+
},
160+
path: {
161+
type: "string",
162+
description: "Optional field path to navigate within the type.",
163+
},
164+
},
165+
required: ["type"],
166+
},
167+
},
86168
{
87169
name: "array_field_reader",
88170
title: "Array Field Reader",

0 commit comments

Comments
 (0)