This helper function will return the ID of the term you are currently viewing (from any taxonomy – you can limit just to a specific taxonomy, or the built-in tag and category taxonomies).
It will return false if you are not on a taxonomy term archive page.
function wpse52578_get_current_term_id(){
if( !is_tax() && !is_tag() && !is_category() )
return false;
//If we got this far we are on a taxonomy-term page
// (or a tag-term or category-term page)
$taxonomy = get_query_var( 'taxonomy' );
$queried_object = get_queried_object();
$term_id = (int) $queried_object->term_id;
return $term_id;
}
Then you can do something like the following:
$tool_term_id = wpse52578_get_current_term_id();
$tax_query = array(
'relation' => 'AND',
array(
'taxonomy' => 'guide-type',
'field' => 'slug',
'terms' => 'video'
));
if( $tool_term_id ){
$tax_query[] = array(
'taxonomy' => 'tool',
'field' => 'id',
'terms' => $tool_term_id
)
}
$args = array('tax_query' => $tax_query);
$query = new WP_Query( $args );
Note: I’ve not tested this