create_slide_file
Save generated Markdown slides as .md files using this tool. Input filename and content to create or overwrite presentation-ready files in a specified directory.
Instructions
生成済みのMarkdownスライドを.mdファイルとして保存します。モデルがMarkdownを出力した直後に続けて実行してください(同名があれば上書き)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The markdown content for the slides | |
| filename | Yes | Name of the markdown file to create (without extension) | |
| output_dir | No | Directory path where the file should be created (default: current directory) | . |
Input Schema (JSON Schema)
{
"properties": {
"content": {
"description": "The markdown content for the slides",
"type": "string"
},
"filename": {
"description": "Name of the markdown file to create (without extension)",
"type": "string"
},
"output_dir": {
"default": ".",
"description": "Directory path where the file should be created (default: current directory)",
"type": "string"
}
},
"required": [
"filename",
"content"
],
"type": "object"
}
Implementation Reference
- src/index.ts:734-755 (handler)The execution handler for the create_slide_file tool. It extracts parameters, ensures the output directory exists, appends .md extension if missing, constructs the filepath, writes the markdown content to the file using Node.js fs.writeFile, and returns a success message.case "create_slide_file": { const { filename, content, output_dir = "." } = args as any; // Ensure the output directory exists await fs.mkdir(output_dir, { recursive: true }); // Add .md extension if not present const finalFilename = filename.endsWith('.md') ? filename : `${filename}.md`; const filepath = path.join(output_dir, finalFilename); // Write the file await fs.writeFile(filepath, content, 'utf-8'); return { content: [ { type: "text", text: `Successfully created slide file: ${filepath}\n\nThe markdown file has been saved and is ready to be used with your preferred presentation tool.`, }, ], }; }
- src/index.ts:33-55 (registration)The tool registration entry in the TOOLS array, defining the name, description, and input schema for the create_slide_file tool. This is returned by the ListTools handler.{ name: "create_slide_file", description: "生成済みのMarkdownスライドを.mdファイルとして保存します。モデルがMarkdownを出力した直後に続けて実行してください(同名があれば上書き)。", inputSchema: { type: "object", properties: { filename: { type: "string", description: "Name of the markdown file to create (without extension)" }, content: { type: "string", description: "The markdown content for the slides" }, output_dir: { type: "string", description: "Directory path where the file should be created (default: current directory)", default: "." } }, required: ["filename", "content"] } }
- src/index.ts:36-54 (schema)The input schema defining the parameters for the create_slide_file tool: filename (string, required), content (string, required), and optional output_dir (string, default '.').inputSchema: { type: "object", properties: { filename: { type: "string", description: "Name of the markdown file to create (without extension)" }, content: { type: "string", description: "The markdown content for the slides" }, output_dir: { type: "string", description: "Directory path where the file should be created (default: current directory)", default: "." } }, required: ["filename", "content"] }