{"record":{"id":"1eef524d9f299095","repo":"Hmbown/CodeWhale","slug":"mcp-resource-uri-uri-was-not-advertised-by-ser","errorCode":null,"errorMessage":"MCP resource URI '{uri}' was not advertised by server '{server_name}'","messagePattern":"MCP resource URI '(.+?)' was not advertised by server '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/mcp.rs","lineNumber":4405,"sourceCode":"        }\n        prompts\n    }\n\n    /// Read a resource from a specific server\n    pub async fn read_resource(\n        &mut self,\n        server_name: &str,\n        uri: &str,\n    ) -> Result<serde_json::Value> {\n        let global_timeouts = self.config.timeouts;\n        let conn = self.get_or_connect(server_name).await?;\n        let advertised_literal = conn.resources().iter().any(|resource| resource.uri == uri);\n        let advertised_template = conn\n            .resource_templates()\n            .iter()\n            .any(|template| resource_uri_matches_template(uri, &template.uri_template));\n        if !advertised_literal && !advertised_template {\n            anyhow::bail!(\"MCP resource URI '{uri}' was not advertised by server '{server_name}'\");\n        }\n        let timeout = conn.config().effective_read_timeout(&global_timeouts);\n        conn.read_resource(uri, timeout).await\n    }\n\n    /// Get a prompt from a specific server\n    pub async fn get_prompt(\n        &mut self,\n        server_name: &str,\n        prompt_name: &str,\n        arguments: serde_json::Value,\n    ) -> Result<serde_json::Value> {\n        let global_timeouts = self.config.timeouts;\n        let conn = self.get_or_connect(server_name).await?;\n        if !conn\n            .prompts()\n            .iter()\n            .any(|prompt| prompt.name == prompt_name)","sourceCodeStart":4387,"sourceCodeEnd":4423,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/mcp.rs#L4387-L4423","documentation":"read_resource authorizes the URI against the server's advertised resources and resource templates before reading; a URI matching neither literal nor template is refused locally so the MCP server is never asked for resources it did not expose.","triggerScenarios":"Thrown at crates/tui/src/mcp.rs:4405 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Refresh the server's advertised resource list (list_resources) and use a URI from that list or one matching a advertised template.","Check the server name and URI for typos; the exact literal URI must match."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}