Skip to content

Commit c0a0684

Browse files
committed
refactor: remove unused list function from resource templates in multiple exercises
1 parent aeea758 commit c0a0684

File tree

20 files changed

+20
-200
lines changed

20 files changed

+20
-200
lines changed

exercises/01.advanced-tools/01.problem.annotations/src/resources.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export async function initializeResources(agent: EpicMeMCP) {
6969
agent.server.registerResource(
7070
'entry',
7171
new ResourceTemplate('epicme://entries/{id}', {
72+
list: undefined,
7273
complete: {
7374
async id(value) {
7475
const entries = await agent.db.getEntries()
@@ -77,16 +78,6 @@ export async function initializeResources(agent: EpicMeMCP) {
7778
.filter((id) => id.includes(value))
7879
},
7980
},
80-
list: async () => {
81-
const entries = await agent.db.getEntries()
82-
return {
83-
resources: entries.map((entry) => ({
84-
name: entry.title,
85-
uri: `epicme://entries/${entry.id}`,
86-
mimeType: 'application/json',
87-
})),
88-
}
89-
},
9081
}),
9182
{
9283
title: 'Journal Entry',

exercises/01.advanced-tools/01.solution.annotations/src/resources.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export async function initializeResources(agent: EpicMeMCP) {
6969
agent.server.registerResource(
7070
'entry',
7171
new ResourceTemplate('epicme://entries/{id}', {
72+
list: undefined,
7273
complete: {
7374
async id(value) {
7475
const entries = await agent.db.getEntries()
@@ -77,16 +78,6 @@ export async function initializeResources(agent: EpicMeMCP) {
7778
.filter((id) => id.includes(value))
7879
},
7980
},
80-
list: async () => {
81-
const entries = await agent.db.getEntries()
82-
return {
83-
resources: entries.map((entry) => ({
84-
name: entry.title,
85-
uri: `epicme://entries/${entry.id}`,
86-
mimeType: 'application/json',
87-
})),
88-
}
89-
},
9081
}),
9182
{
9283
title: 'Journal Entry',

exercises/01.advanced-tools/02.problem.structured/src/resources.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export async function initializeResources(agent: EpicMeMCP) {
6969
agent.server.registerResource(
7070
'entry',
7171
new ResourceTemplate('epicme://entries/{id}', {
72+
list: undefined,
7273
complete: {
7374
async id(value) {
7475
const entries = await agent.db.getEntries()
@@ -77,16 +78,6 @@ export async function initializeResources(agent: EpicMeMCP) {
7778
.filter((id) => id.includes(value))
7879
},
7980
},
80-
list: async () => {
81-
const entries = await agent.db.getEntries()
82-
return {
83-
resources: entries.map((entry) => ({
84-
name: entry.title,
85-
uri: `epicme://entries/${entry.id}`,
86-
mimeType: 'application/json',
87-
})),
88-
}
89-
},
9081
}),
9182
{
9283
title: 'Journal Entry',

exercises/01.advanced-tools/02.solution.structured/src/resources.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export async function initializeResources(agent: EpicMeMCP) {
6969
agent.server.registerResource(
7070
'entry',
7171
new ResourceTemplate('epicme://entries/{id}', {
72+
list: undefined,
7273
complete: {
7374
async id(value) {
7475
const entries = await agent.db.getEntries()
@@ -77,16 +78,6 @@ export async function initializeResources(agent: EpicMeMCP) {
7778
.filter((id) => id.includes(value))
7879
},
7980
},
80-
list: async () => {
81-
const entries = await agent.db.getEntries()
82-
return {
83-
resources: entries.map((entry) => ({
84-
name: entry.title,
85-
uri: `epicme://entries/${entry.id}`,
86-
mimeType: 'application/json',
87-
})),
88-
}
89-
},
9081
}),
9182
{
9283
title: 'Journal Entry',

exercises/02.elicitation/01.problem/src/resources.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export async function initializeResources(agent: EpicMeMCP) {
6969
agent.server.registerResource(
7070
'entry',
7171
new ResourceTemplate('epicme://entries/{id}', {
72+
list: undefined,
7273
complete: {
7374
async id(value) {
7475
const entries = await agent.db.getEntries()
@@ -77,16 +78,6 @@ export async function initializeResources(agent: EpicMeMCP) {
7778
.filter((id) => id.includes(value))
7879
},
7980
},
80-
list: async () => {
81-
const entries = await agent.db.getEntries()
82-
return {
83-
resources: entries.map((entry) => ({
84-
name: entry.title,
85-
uri: `epicme://entries/${entry.id}`,
86-
mimeType: 'application/json',
87-
})),
88-
}
89-
},
9081
}),
9182
{
9283
title: 'Journal Entry',

exercises/02.elicitation/01.solution/src/resources.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export async function initializeResources(agent: EpicMeMCP) {
6969
agent.server.registerResource(
7070
'entry',
7171
new ResourceTemplate('epicme://entries/{id}', {
72+
list: undefined,
7273
complete: {
7374
async id(value) {
7475
const entries = await agent.db.getEntries()
@@ -77,16 +78,6 @@ export async function initializeResources(agent: EpicMeMCP) {
7778
.filter((id) => id.includes(value))
7879
},
7980
},
80-
list: async () => {
81-
const entries = await agent.db.getEntries()
82-
return {
83-
resources: entries.map((entry) => ({
84-
name: entry.title,
85-
uri: `epicme://entries/${entry.id}`,
86-
mimeType: 'application/json',
87-
})),
88-
}
89-
},
9081
}),
9182
{
9283
title: 'Journal Entry',

exercises/03.sampling/01.problem.simple/src/resources.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export async function initializeResources(agent: EpicMeMCP) {
6969
agent.server.registerResource(
7070
'entry',
7171
new ResourceTemplate('epicme://entries/{id}', {
72+
list: undefined,
7273
complete: {
7374
async id(value) {
7475
const entries = await agent.db.getEntries()
@@ -77,16 +78,6 @@ export async function initializeResources(agent: EpicMeMCP) {
7778
.filter((id) => id.includes(value))
7879
},
7980
},
80-
list: async () => {
81-
const entries = await agent.db.getEntries()
82-
return {
83-
resources: entries.map((entry) => ({
84-
name: entry.title,
85-
uri: `epicme://entries/${entry.id}`,
86-
mimeType: 'application/json',
87-
})),
88-
}
89-
},
9081
}),
9182
{
9283
title: 'Journal Entry',

exercises/03.sampling/01.solution.simple/src/resources.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export async function initializeResources(agent: EpicMeMCP) {
6969
agent.server.registerResource(
7070
'entry',
7171
new ResourceTemplate('epicme://entries/{id}', {
72+
list: undefined,
7273
complete: {
7374
async id(value) {
7475
const entries = await agent.db.getEntries()
@@ -77,16 +78,6 @@ export async function initializeResources(agent: EpicMeMCP) {
7778
.filter((id) => id.includes(value))
7879
},
7980
},
80-
list: async () => {
81-
const entries = await agent.db.getEntries()
82-
return {
83-
resources: entries.map((entry) => ({
84-
name: entry.title,
85-
uri: `epicme://entries/${entry.id}`,
86-
mimeType: 'application/json',
87-
})),
88-
}
89-
},
9081
}),
9182
{
9283
title: 'Journal Entry',

exercises/03.sampling/02.problem.advanced/src/resources.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export async function initializeResources(agent: EpicMeMCP) {
6969
agent.server.registerResource(
7070
'entry',
7171
new ResourceTemplate('epicme://entries/{id}', {
72+
list: undefined,
7273
complete: {
7374
async id(value) {
7475
const entries = await agent.db.getEntries()
@@ -77,16 +78,6 @@ export async function initializeResources(agent: EpicMeMCP) {
7778
.filter((id) => id.includes(value))
7879
},
7980
},
80-
list: async () => {
81-
const entries = await agent.db.getEntries()
82-
return {
83-
resources: entries.map((entry) => ({
84-
name: entry.title,
85-
uri: `epicme://entries/${entry.id}`,
86-
mimeType: 'application/json',
87-
})),
88-
}
89-
},
9081
}),
9182
{
9283
title: 'Journal Entry',

exercises/03.sampling/02.solution.advanced/src/resources.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export async function initializeResources(agent: EpicMeMCP) {
6969
agent.server.registerResource(
7070
'entry',
7171
new ResourceTemplate('epicme://entries/{id}', {
72+
list: undefined,
7273
complete: {
7374
async id(value) {
7475
const entries = await agent.db.getEntries()
@@ -77,16 +78,6 @@ export async function initializeResources(agent: EpicMeMCP) {
7778
.filter((id) => id.includes(value))
7879
},
7980
},
80-
list: async () => {
81-
const entries = await agent.db.getEntries()
82-
return {
83-
resources: entries.map((entry) => ({
84-
name: entry.title,
85-
uri: `epicme://entries/${entry.id}`,
86-
mimeType: 'application/json',
87-
})),
88-
}
89-
},
9081
}),
9182
{
9283
title: 'Journal Entry',

0 commit comments

Comments
 (0)