Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Migrate last response to types
  • Loading branch information
Theodore Li committed Feb 12, 2026
commit dce47a101cb20dae4da14a949f5a2d5a5a478f9d
32 changes: 31 additions & 1 deletion apps/sim/tools/google_books/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ToolResponse } from '@/tools/types'

/**
* Raw volume item from Google Books API response
* Raw volume item from Google Books API search response
*/
export interface GoogleBooksVolumeItem {
id: string
Expand Down Expand Up @@ -30,6 +30,36 @@ export interface GoogleBooksVolumeItem {
}
}

/**
* Raw volume response from Google Books API details endpoint
*/
export interface GoogleBooksVolumeResponse {
id: string
volumeInfo: {
title?: string
subtitle?: string
authors?: string[]
publisher?: string
publishedDate?: string
description?: string
pageCount?: number
categories?: string[]
averageRating?: number
ratingsCount?: number
language?: string
previewLink?: string
infoLink?: string
imageLinks?: {
thumbnail?: string
smallThumbnail?: string
}
industryIdentifiers?: Array<{
type: string
identifier: string
}>
}
}

/**
* Volume information structure shared between search and details responses
*/
Expand Down
28 changes: 1 addition & 27 deletions apps/sim/tools/google_books/volume_details.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,10 @@
import type {
GoogleBooksVolumeDetailsParams,
GoogleBooksVolumeDetailsResponse,
GoogleBooksVolumeResponse,
} from '@/tools/google_books/types'
import type { ToolConfig } from '@/tools/types'

interface GoogleBooksVolumeResponse {
id: string
volumeInfo: {
title?: string
subtitle?: string
authors?: string[]
publisher?: string
publishedDate?: string
description?: string
pageCount?: number
categories?: string[]
averageRating?: number
ratingsCount?: number
language?: string
previewLink?: string
infoLink?: string
imageLinks?: {
thumbnail?: string
smallThumbnail?: string
}
industryIdentifiers?: Array<{
type: string
identifier: string
}>
}
}

export const googleBooksVolumeDetailsTool: ToolConfig<
GoogleBooksVolumeDetailsParams,
GoogleBooksVolumeDetailsResponse
Expand Down