write_analysis_file
Save analysis code and results to a file for documentation and reuse in quantitative research workflows.
Instructions
분석 코드/결과를 파일로 저장
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | 파일 내용 | |
| filename | Yes | 파일명 | |
| directory | No | 저장 디렉토리 | |
| encoding | No | 인코딩 (기본: utf-8) |
Implementation Reference
- src/tools/index.ts:1948-1960 (handler)The handler function for the 'write_analysis_file' tool. It extracts the content, filename, and directory from the input arguments and returns a response simulating file writing (notes that actual fs access is required).async function handleWriteAnalysisFile(args: Record<string, unknown>) { const content = args.content as string; const filename = args.filename as string; const directory = (args.directory as string) || "."; // Note: Actual file writing would require fs module return { status: "File writing capability - requires file system access", filename, directory, content_preview: content.substring(0, 200) + "..." }; }
- src/tools/index.ts:744-756 (schema)The tool registration in the tools array, including the input schema defining parameters: content (string, required), filename (string, required), directory (string, optional), encoding (string, optional).name: "write_analysis_file", description: "분석 코드/결과를 파일로 저장", inputSchema: { type: "object", properties: { content: { type: "string", description: "파일 내용" }, filename: { type: "string", description: "파일명" }, directory: { type: "string", description: "저장 디렉토리" }, encoding: { type: "string", description: "인코딩 (기본: utf-8)" }, }, required: ["content", "filename"], }, },
- src/tools/index.ts:896-898 (registration)The dispatch case in the handleToolCall switch statement that routes calls to the write_analysis_file tool to its handler function.case "write_analysis_file": return handleWriteAnalysisFile(args); case "create_project_structure":