Skip to content

Commit 509393d

Browse files
Copilotdata-douser
andauthored
docs: improve extractContentText documentation per code review feedback
Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/78e52dbe-a4f9-4a7a-b042-c14ad89421b1 Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
1 parent 6e99d77 commit 509393d

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

client/internal/mcp/primitives.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@ func FormatPromptMessagesMarkdown(pm *PromptMessages) string {
268268
}
269269

270270
// extractContentText extracts the text from an MCP Content interface value.
271+
// MCP prompt messages use the Content interface which can be TextContent,
272+
// ImageContent, AudioContent, or EmbeddedResource. This function handles
273+
// TextContent directly and falls back to JSON serialization for other types
274+
// (e.g., image or audio content), preserving the data for the caller.
271275
func extractContentText(content mcp.Content) string {
272276
if tc, ok := content.(mcp.TextContent); ok {
273277
return tc.Text
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
module languages/go/tools/test/CallGraphFrom
2+
3+
go 1.21.13
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
module languages/go/tools/test/CallGraphFromTo
2+
3+
go 1.21.13
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
module languages/go/tools/test/CallGraphTo
2+
3+
go 1.21.13
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module languages/go/tools/test/PrintAST
22

3-
go 1.20
3+
go 1.20

0 commit comments

Comments
 (0)