Skip to content

Commit 6a71581

Browse files
committed
カテゴリーごとのイントロを含める機能を追加。content-apiおよびmanagement-apiに対するイントロダクションをファイルから読み込み、レスポンスに追加する処理を実装。
1 parent 7c1a432 commit 6a71581

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

dist/index.js

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,22 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
184184
try {
185185
const content = await fs.readFile(filePath, 'utf-8');
186186
let responseText = `カテゴリー: ${foundCategory}\nファイル: ${filename}\n\n${content}`;
187+
188+
// 追加: カテゴリーごとのイントロを含める
189+
if (category === 'content-api') {
190+
const introPath = path.join(DOCS_DIR, 'content-api', 'コンテンツAPIとは.md');
191+
try {
192+
const introContent = await fs.readFile(introPath, 'utf-8');
193+
responseText = `【コンテンツAPIとは】\n${introContent}\n\n---\n` + responseText;
194+
} catch { }
195+
} else if (category === 'management-api') {
196+
const introPath = path.join(DOCS_DIR, 'management-api', 'マネジメントAPIとは.md');
197+
try {
198+
const introContent = await fs.readFile(introPath, 'utf-8');
199+
responseText = `【マネジメントAPIとは】\n${introContent}\n\n---\n` + responseText;
200+
} catch { }
201+
}
202+
187203
return {
188204
content: [
189205
{

0 commit comments

Comments
 (0)