Skip to main content

read_source

Function read_source 

Source
pub fn read_source(
    file_path: &str,
    allowed_dirs: &[String],
    opts: &ReadOpts,
) -> String
Expand description

Read a file from one of the allowed source dirs.

Returns a user-facing string. Path traversal attempts and missing files surface as Error: … strings rather than panics, mirroring the existing Python-server behaviour so the agent sees a clean error in tool output rather than an MCP error envelope.