mirror of
https://github.com/ArthurDanjou/artapi.git
synced 2026-01-24 23:40:27 +01:00
Add API endpoints for content and update MCP resources to use them
Co-authored-by: ArthurDanjou <29738535+ArthurDanjou@users.noreply.github.com>
This commit is contained in:
@@ -4,17 +4,13 @@ export default defineMcpResource({
|
||||
uri: 'resource://artmcp/languages',
|
||||
cache: '1 hour',
|
||||
handler: async (uri: URL) => {
|
||||
const event = useEvent()
|
||||
|
||||
const result = await queryCollection(event, 'languages')
|
||||
.where('extension', '=', 'json')
|
||||
.first()
|
||||
const result = await $fetch('/api/languages')
|
||||
|
||||
return {
|
||||
contents: [{
|
||||
uri: uri.toString(),
|
||||
mimeType: 'text/json',
|
||||
text: JSON.stringify(result.body, null, 2)
|
||||
text: JSON.stringify(result, null, 2)
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user